summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-06-13 12:19:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-13 18:49:39 (GMT)
commite93021b20a73af8ff51f9ddd8c98f44fd103f360 (patch)
tree81eac1241c7421e98d705fba74ebb4e76f8faca4 /cache.h
parentd4a2024aef90fa5dd2b0e5027f9340719ff20748 (diff)
downloadgit-e93021b20a73af8ff51f9ddd8c98f44fd103f360.zip
git-e93021b20a73af8ff51f9ddd8c98f44fd103f360.tar.gz
git-e93021b20a73af8ff51f9ddd8c98f44fd103f360.tar.bz2
read-cache: save index SHA-1 after reading
Also update SHA-1 after writing. If we do not do that, the second read_index() will see "initialized" variable already set and not read .git/index again, which is fine, except istate->sha1 now has a stale value. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index bf09d1c..41cdcd0 100644
--- a/cache.h
+++ b/cache.h
@@ -286,6 +286,7 @@ struct index_state {
initialized : 1;
struct hashmap name_hash;
struct hashmap dir_hash;
+ unsigned char sha1[20];
};
extern struct index_state the_index;