diff options
Diffstat (limited to 'builtin/rev-parse.c')
-rw-r--r-- | builtin/rev-parse.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 852e49e340..434646b074 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -4,20 +4,21 @@ * Copyright (C) Linus Torvalds, 2005 */ #define USE_THE_INDEX_VARIABLE -#include "cache.h" +#include "builtin.h" #include "abspath.h" -#include "alloc.h" #include "config.h" #include "commit.h" #include "environment.h" #include "gettext.h" +#include "hash.h" #include "hex.h" #include "refs.h" #include "quote.h" -#include "builtin.h" #include "object-name.h" #include "parse-options.h" +#include "path.h" #include "diff.h" +#include "read-cache-ll.h" #include "revision.h" #include "setup.h" #include "split-index.h" @@ -156,9 +157,12 @@ static void show_rev(int type, const struct object_id *oid, const char *name) */ break; case 1: /* happy */ - if (abbrev_ref) + if (abbrev_ref) { + char *old = full; full = shorten_unambiguous_ref(full, abbrev_ref_strict); + free(old); + } show_with_type(type, full); break; default: /* ambiguous */ |