diff options
Diffstat (limited to 'rev-parse.c')
-rw-r--r-- | rev-parse.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rev-parse.c b/rev-parse.c index 1c6ae76f9a..39cf63540e 100644 --- a/rev-parse.c +++ b/rev-parse.c @@ -134,7 +134,8 @@ int main(int argc, char **argv) { int i, as_is = 0; unsigned char sha1[20]; - + const char *prefix = setup_git_directory(); + for (i = 1; i < argc; i++) { char *arg = argv[i]; char *dotdot; @@ -189,6 +190,10 @@ int main(int argc, char **argv) for_each_ref(show_reference); continue; } + if (!strcmp(arg, "--show-prefix")) { + puts(prefix); + continue; + } show_arg(arg); continue; } |