Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-11 08:52:23 +0300
committerJunio C Hamano <gitster@pobox.com>2017-10-11 08:52:23 +0300
commit6defdc9fe863bd637102f8b5420501654d4a9346 (patch)
treec889514e52b2b845e9e3a624015ff2ddc4b39227 /fsck.c
parent40abbe4306e65e604ea5c5bf2ff37f010db5cc81 (diff)
parent2720f6db5d35fece41190b93a1eba76d2f64f490 (diff)
Merge branch 'rs/fsck-null-return-from-lookup'
Improve behaviour of "git fsck" upon finding a missing object. * rs/fsck-null-return-from-lookup: fsck: handle NULL return of lookup_blob() and lookup_tree()
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fsck.c b/fsck.c
index 2ad00fc4d0..032699e9ac 100644
--- a/fsck.c
+++ b/fsck.c
@@ -358,15 +358,15 @@ static int fsck_walk_tree(struct tree *tree, void *data, struct fsck_options *op
continue;
if (S_ISDIR(entry.mode)) {
- obj = &lookup_tree(entry.oid)->object;
- if (name)
+ obj = (struct object *)lookup_tree(entry.oid);
+ if (name && obj)
put_object_name(options, obj, "%s%s/", name,
entry.path);
result = options->walk(obj, OBJ_TREE, data, options);
}
else if (S_ISREG(entry.mode) || S_ISLNK(entry.mode)) {
- obj = &lookup_blob(entry.oid)->object;
- if (name)
+ obj = (struct object *)lookup_blob(entry.oid);
+ if (name && obj)
put_object_name(options, obj, "%s%s", name,
entry.path);
result = options->walk(obj, OBJ_BLOB, data, options);