Fix git-describe reference adding when there are no tags and thus no output
authorJonas Fonseca <fonseca@diku.dk>
Mon, 11 Sep 2006 04:04:02 +0000 (06:04 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Mon, 11 Sep 2006 04:04:02 +0000 (06:04 +0200)
tig.c

diff --git a/tig.c b/tig.c
index 44fcb1b..bcff66f 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2333,10 +2333,14 @@ add_pager_refs(struct view *view, struct line *line)
 
        if (!is_tag && view == VIEW(REQ_VIEW_DIFF)) {
 try_add_describe_ref:
+               /* Add <tag>-g<commit_id> "fake" reference. */
                if (!add_describe_ref(buf, &bufpos, commit_id, sep))
                        return;
        }
 
+       if (bufpos == 0)
+               return;
+
        if (!realloc_lines(view, view->line_size + 1))
                return;