summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eaa8677)
raw | patch | inline | side by side (parent: eaa8677)
author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 30 May 2007 06:13:14 +0000 (02:13 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 30 May 2007 06:31:06 +0000 (23:31 -0700) |
In this particular location of fsck the index should have already
been opened by verify_pack, which is called just before we get
here and loop through the object names. However, just in case a
future version of that function does not use the index file we'll
double-check its open before we access the num_objects field.
Better safe now than sorry later.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
been opened by verify_pack, which is called just before we get
here and loop through the object names. However, just in case a
future version of that function does not use the index file we'll
double-check its open before we access the num_objects field.
Better safe now than sorry later.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-fsck.c | patch | blob | history |
diff --git a/builtin-fsck.c b/builtin-fsck.c
index cbbcaf011a09d1dd9b3f2a01d18e1ab93e26fd3b..9959818ceddf52ec24d9b24b0cade558f4d43070 100644 (file)
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
verify_pack(p, 0);
for (p = packed_git; p; p = p->next) {
- uint32_t i, num = p->num_objects;
+ uint32_t i, num;
+ if (open_pack_index(p))
+ continue;
+ num = p->num_objects;
for (i = 0; i < num; i++)
fsck_sha1(nth_packed_object_sha1(p, i));
}