describe: do not silently ignore indescribable commits
[gitweb.git] / describe.c
index 84d96b5b82bf5d1b688da39208077df5ca6ef6d9..5548a16e4d97690e207a6e7cd0699aa8de73f81f 100644 (file)
@@ -18,7 +18,7 @@ static int names = 0, allocs = 0;
 static struct commit_name {
        const struct commit *commit;
        int prio; /* annotated tag = 2, tag = 1, head = 0 */
-       char path[];
+       char path[FLEX_ARRAY]; /* more */
 } **name_array = NULL;
 
 static struct commit_name *match(struct commit *cmit)
@@ -124,9 +124,11 @@ static void describe(struct commit *cmit)
                if (n) {
                        printf("%s-g%s\n", n->path,
                               find_unique_abbrev(cmit->object.sha1, abbrev));
+                       clear_commit_marks(cmit, SEEN);
                        return;
                }
        }
+       die("cannot describe '%s'", sha1_to_hex(cmit->object.sha1));
 }
 
 int main(int argc, char **argv)