Skip to content

Commit

Permalink
Update git-cherry-pick.rst
Browse files Browse the repository at this point in the history
Using the parent of the cherry-picked commit as ancestor is not correct sometimes. That looks to be an issue because `base` was not used at all in the example whereas it should be used as ancestor.
  • Loading branch information
herrerog authored Jan 11, 2024
1 parent 54b9c43 commit 3cbf20d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/recipes/git-cherry-pick.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ example `three-argument rebases`_.
cherry = repo.revparse_single('9e044d03c')
basket = repo.branches.get('basket')
base = repo.merge_base(cherry.id, basket.target)
base_tree = cherry.parents[0].tree
base = repo.merge_base(cherry.id, basket.target)
index = repo.merge_trees(base_tree, basket, cherry)
index = repo.merge_trees(base, basket, cherry)
tree_id = index.write_tree(repo)
author = cherry.author
Expand Down

0 comments on commit 3cbf20d

Please sign in to comment.