aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-03 10:41:31 -0700
committerJunio C Hamano <gitster@pobox.com>2015-08-03 10:41:31 -0700
commit0533a9b70cc768438a817103f02c51bc4f52bf45 (patch)
tree1d69e2fd8a639c2ec1c45957c8f4c0b5e02f35a1 /builtin
parenta94594dcf7522652363773c06e1ff617914dffe8 (diff)
parent501cf47cddfbf8040b6f9b8ac06d13094a70f729 (diff)
downloadgit-0533a9b70cc768438a817103f02c51bc4f52bf45.tar.gz
git-0533a9b70cc768438a817103f02c51bc4f52bf45.tar.xz
Merge branch 'mh/reporting-broken-refs-from-for-each-ref' into maint
"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 83f9cf916..13d217240 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -851,6 +851,11 @@ static int grab_single_ref(const char *refname, const unsigned char *sha1, int f
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);