From 182d7dc46b23b4a20985c93ea3a6ba3e6f267ff6 Mon Sep 17 00:00:00 2001 From: Hiroshige Umino Date: Thu, 5 Sep 2013 23:57:23 +0900 Subject: 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 Signed-off-by: Junio C Hamano --- builtin/revert.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin/revert.c') diff --git a/builtin/revert.c b/builtin/revert.c index 0401fdb02c..e264a151ea 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) -- cgit v1.2.1