summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c374b91)
raw | patch | inline | side by side (parent: c374b91)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Mar 2008 21:08:26 +0000 (13:08 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Mar 2008 21:09:20 +0000 (13:09 -0800) |
An error while hand-merging broke the new "--long" option.
This should fix it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This should fix it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-describe.c | patch | blob | history |
diff --git a/builtin-describe.c b/builtin-describe.c
index c549d362b27c422b92dbcdd3681e22b7523e0f48..43be671827ee1ec1b9bebb61f803059e674ad5a2 100644 (file)
--- a/builtin-describe.c
+++ b/builtin-describe.c
printf("%s", n->tag->tag);
else
printf("%s", n->path);
- if (longformat)
- printf("-0-g%s",
- find_unique_abbrev(n->tag->tagged->sha1, abbrev));
+}
+
+static void show_suffix(int depth, const unsigned char *sha1)
+{
+ printf("-%d-g%s", depth, find_unique_abbrev(sha1, abbrev));
}
static void describe(const char *arg, int last_one)
n = cmit->util;
if (n) {
+ /*
+ * Exact match to an existing ref.
+ */
display_name(n);
+ if (longformat)
+ show_suffix(0, n->tag->tagged->sha1);
printf("\n");
return;
}
display_name(all_matches[0].name);
if (abbrev)
- printf("-%d-g%s", all_matches[0].depth,
- find_unique_abbrev(cmit->object.sha1, abbrev));
+ show_suffix(all_matches[0].depth, cmit->object.sha1);
printf("\n");
if (!last_one)