merge script: --squash, --ff from unborn branch are errors
[gitweb.git] / builtin / branch.c
index 5f0873ab689ac805f24c749709ed314419e35c08..87976f0921d87f2a8564eb54aa3b81d30ee7f214 100644 (file)
@@ -43,13 +43,13 @@ enum color_branch {
        BRANCH_COLOR_PLAIN = 1,
        BRANCH_COLOR_REMOTE = 2,
        BRANCH_COLOR_LOCAL = 3,
-       BRANCH_COLOR_CURRENT = 4,
+       BRANCH_COLOR_CURRENT = 4
 };
 
 static enum merge_filter {
        NO_FILTER = 0,
        SHOW_NOT_MERGED,
-       SHOW_MERGED,
+       SHOW_MERGED
 } merge_filter;
 static unsigned char merge_filter_ref[20];
 
@@ -301,7 +301,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
                commit = lookup_commit_reference_gently(sha1, 1);
                if (!commit) {
                        cb->ret = error("branch '%s' does not point at a commit", refname);
-                       return cb->ret;
+                       return 0;
                }
 
                /* Filter with with_commit if specified */
@@ -539,6 +539,9 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
 
        free_ref_list(&ref_list);
 
+       if (cb.ret)
+               error("some refs could not be read");
+
        return cb.ret;
 }