summaryrefslogtreecommitdiff
path: root/builtin/revert.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-09-20 19:29:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-09-20 19:29:58 (GMT)
commit08092082b7ba6435662310a945c7c96e42278f0a (patch)
tree426a2114be21571015d813c5f48b393b978753d6 /builtin/revert.c
parent6d3e1f2e453f7473d4ab64ef378309958613c5d7 (diff)
parent182d7dc46b23b4a20985c93ea3a6ba3e6f267ff6 (diff)
downloadgit-08092082b7ba6435662310a945c7c96e42278f0a.zip
git-08092082b7ba6435662310a945c7c96e42278f0a.tar.gz
git-08092082b7ba6435662310a945c7c96e42278f0a.tar.bz2
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/revert.c')
-rw-r--r--builtin/revert.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index 8e87acd..52c35e7 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)