aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-09-20 12:29:57 -0700
committerJunio C Hamano <gitster@pobox.com>2013-09-20 12:29:58 -0700
commit08092082b7ba6435662310a945c7c96e42278f0a (patch)
tree426a2114be21571015d813c5f48b393b978753d6 /builtin
parent6d3e1f2e453f7473d4ab64ef378309958613c5d7 (diff)
parent182d7dc46b23b4a20985c93ea3a6ba3e6f267ff6 (diff)
downloadgit-08092082b7ba6435662310a945c7c96e42278f0a.tar.gz
git-08092082b7ba6435662310a945c7c96e42278f0a.tar.xz
Merge branch 'hu/cherry-pick-previous-branch'
Just like "git checkout -" knows to check out and "git merge -" knows to merge the branch you were previously on, "git cherry-pick" now understands "git cherry-pick -" to pick from the previous branch. * hu/cherry-pick-previous-branch: cherry-pick: allow "-" as abbreviation of '@{-1}'
Diffstat (limited to 'builtin')
-rw-r--r--builtin/revert.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index 8e87acd12..52c35e75d 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -202,6 +202,8 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix)
memset(&opts, 0, sizeof(opts));
opts.action = REPLAY_PICK;
git_config(git_default_config, NULL);
+ if (!strcmp(argv[1], "-"))
+ argv[1] = "@{-1}";
parse_args(argc, argv, &opts);
res = sequencer_pick_revisions(&opts);
if (res < 0)