summaryrefslogtreecommitdiff
path: root/builtin/revert.c
diff options
context:
space:
mode:
authorHiroshige Umino <hiroshige88@gmail.com>2013-09-05 14:57:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-09-09 18:17:11 (GMT)
commit182d7dc46b23b4a20985c93ea3a6ba3e6f267ff6 (patch)
treecc2b74ef4b6f2a29d9eeed5e3dd6c2967c1ef6b9 /builtin/revert.c
parente5be297279e8ee8c503eb59da21ab17edc40e748 (diff)
downloadgit-182d7dc46b23b4a20985c93ea3a6ba3e6f267ff6.zip
git-182d7dc46b23b4a20985c93ea3a6ba3e6f267ff6.tar.gz
git-182d7dc46b23b4a20985c93ea3a6ba3e6f267ff6.tar.bz2
cherry-pick: allow "-" as abbreviation of '@{-1}'
"-" abbreviation is handy for "cherry-pick" like "checkout" and "merge". It's also good for uniformity that a "-" stands as the name of the previous branch where a branch name is accepted and it could not mean any other things like stdin. Signed-off-by: Hiroshige Umino <hiroshige88@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 0401fdb..e264a15 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -232,6 +232,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)