Skip to content

Commit

Permalink
Merge branch 'sb/check-return-from-read-ref' into jch
Browse files Browse the repository at this point in the history
* sb/check-return-from-read-ref:
  transport-helper: die on errors reading refs.
  • Loading branch information
gitster committed Aug 3, 2015
2 parents ce1b8bd + ae25fd3 commit fc4b58d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions transport-helper.c
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit fc4b58d

Please sign in to comment.