diff options
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r-- | builtin-checkout.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c index dc1de06279..b0a101bac7 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -679,6 +679,9 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) arg = argv[0]; has_dash_dash = (argc > 1) && !strcmp(argv[1], "--"); + if (!strcmp(arg, "-")) + arg = "@{-1}"; + if (get_sha1(arg, rev)) { if (has_dash_dash) /* case (1) */ die("invalid reference: %s", arg); |