diff options
author | David Turner <dturner@twopensource.com> | 2015-11-30 17:47:42 -0500 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2015-12-01 18:19:35 -0500 |
commit | 8c24d832cdcc1602fb5c7e7295447f8043879bf7 (patch) | |
tree | 50777861810c9eb603e02e382a19c7050524ef06 | |
parent | Merge branch 'eg/p4-submit-catch-failure' into maint (diff) | |
download | tgif-8c24d832cdcc1602fb5c7e7295447f8043879bf7.tar.xz |
verify_pack: do not ignore return value of verification function
In verify_pack, a caller-supplied verification function is called.
The function returns an int. If that return value is non-zero,
verify_pack should fail.
The only caller of verify_pack is in builtin/fsck.c, whose verify_fn
returns a meaningful error code (which was then ignored). Now, fsck
might return a different error code (with more detail). This would
happen in the unlikely event that a commit or tree that is a valid git
object but not a valid instance of its type gets into a pack.
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Jeff King <peff@peff.net>
-rw-r--r-- | pack-check.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pack-check.c b/pack-check.c index 63a595c45c..433bd86ccd 100644 --- a/pack-check.c +++ b/pack-check.c @@ -126,7 +126,7 @@ static int verify_packfile(struct packed_git *p, sha1_to_hex(entries[i].sha1), p->pack_name); else if (fn) { int eaten = 0; - fn(entries[i].sha1, type, size, data, &eaten); + err |= fn(entries[i].sha1, type, size, data, &eaten); if (eaten) data = NULL; } |