summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-25 16:09:16 -0700
committerJunio C Hamano <gitster@pobox.com>2015-08-25 16:09:16 -0700
commit7a23807407a2da88929bbeb826ac5030ee8285ca (patch)
tree16f2a7daca89dfec664600978a11e8b56a1a48bd
parent425a4c7734db768d93d3b35c2d26ae50d22893c0 (diff)
parentae25fd39bc6fdc3457976c8d3398aa0fda352f97 (diff)
downloadgit-7a23807407a2da88929bbeb826ac5030ee8285ca.tar.gz
Merge branch 'sb/check-return-from-read-ref' into maint
* sb/check-return-from-read-ref: transport-helper: die on errors reading refs.
-rw-r--r--transport-helper.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 5d99a6bc2e..68e498eebd 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -490,7 +490,8 @@ static int fetch_with_import(struct transport *transport,
else
private = xstrdup(name);
if (private) {
- read_ref(private, posn->old_sha1);
+ if (read_ref(private, posn->old_sha1) < 0)
+ die("Could not read ref %s", private);
free(private);
}
}
@@ -1019,7 +1020,10 @@ static struct ref *get_refs_list(struct transport *transport, int for_push)
if (eon) {
if (has_attribute(eon + 1, "unchanged")) {
(*tail)->status |= REF_STATUS_UPTODATE;
- read_ref((*tail)->name, (*tail)->old_sha1);
+ if (read_ref((*tail)->name,
+ (*tail)->old_sha1) < 0)
+ die(N_("Could not read ref %s"),
+ (*tail)->name);
}
}
tail = &((*tail)->next);