Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
do not write null sha1s to on-disk index
[gitweb.git]
/
read-cache.c
diff --git
a/read-cache.c
b/read-cache.c
index 274e54b4f31da69bf7c0721d4c8ba8e264db5dde..5ae7f2b680d8788f4c806d9c6ec111b6ba339aaa 100644
(file)
--- a/
read-cache.c
+++ b/
read-cache.c
@@
-1615,6
+1615,8
@@
int write_index(struct index_state *istate, int newfd)
continue;
if (!ce_uptodate(ce) && is_racy_timestamp(istate, ce))
ce_smudge_racily_clean_entry(ce);
+ if (is_null_sha1(ce->sha1))
+ return error("cache entry has null sha1: %s", ce->name);
if (ce_write_entry(&c, newfd, ce) < 0)
return -1;
}