aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-24 12:21:51 -0700
committerJunio C Hamano <gitster@pobox.com>2015-06-24 12:21:52 -0700
commit9d71c5f408dabb94f21891f69de17aa72d4787c3 (patch)
treed1645bb0714e12e36b3c06300ef39f3d402c770f /builtin
parent54a17cdb9c56cec06f48c8e24b58da795fef301f (diff)
parent501cf47cddfbf8040b6f9b8ac06d13094a70f729 (diff)
downloadgit-9d71c5f408dabb94f21891f69de17aa72d4787c3.tar.gz
git-9d71c5f408dabb94f21891f69de17aa72d4787c3.tar.xz
Merge branch 'mh/reporting-broken-refs-from-for-each-ref'
"git for-each-ref" reported "missing object" for 0{40} when it encounters a broken ref. The lack of object whose name is 0{40} is not the problem; the ref being broken is. * mh/reporting-broken-refs-from-for-each-ref: read_loose_refs(): treat NULL_SHA1 loose references as broken read_loose_refs(): simplify function logic for-each-ref: report broken references correctly t6301: new tests of for-each-ref error handling
Diffstat (limited to 'builtin')
-rw-r--r--builtin/for-each-ref.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index f7e51a7fa..cb7db230d 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -866,6 +866,11 @@ static int grab_single_ref(const char *refname, const struct object_id *oid,
return 0;
}
+ if (flag & REF_ISBROKEN) {
+ warning("ignoring broken ref %s", refname);
+ return 0;
+ }
+
if (*cb->grab_pattern) {
const char **pattern;
int namelen = strlen(refname);