summaryrefslogtreecommitdiffabout
path: root/ui-log.c
Unidiff
Diffstat (limited to 'ui-log.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-log.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/ui-log.c b/ui-log.c
index 8dd8b89..d212984 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -66,2 +66,13 @@ void print_commit(struct commit *commit)
66 66
67static const char *disambiguate_ref(const char *ref)
68{
69 unsigned char sha1[20];
70 const char *longref;
71
72 longref = fmt("refs/heads/%s", ref);
73 if (get_sha1(longref, sha1) == 0)
74 return longref;
75
76 return ref;
77}
67 78
@@ -72,3 +83,3 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
72 struct commit *commit; 83 struct commit *commit;
73 const char *argv[] = {NULL, tip, NULL, NULL, NULL}; 84 const char *argv[] = {NULL, NULL, NULL, NULL, NULL};
74 int argc = 2; 85 int argc = 2;
@@ -77,3 +88,5 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
77 if (!tip) 88 if (!tip)
78 argv[1] = ctx.qry.head; 89 tip = ctx.qry.head;
90
91 argv[1] = disambiguate_ref(tip);
79 92