diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/index.c | 6 | ||||
-rw-r--r-- | src/index.h | 2 | ||||
-rw-r--r-- | src/submodule.c | 5 | ||||
-rw-r--r-- | src/submodule.h | 2 |
4 files changed, 6 insertions, 9 deletions
diff --git a/src/index.c b/src/index.c index ba101ea14..1fb3c48f3 100644 --- a/src/index.c +++ b/src/index.c @@ -679,15 +679,13 @@ int git_index_read(git_index *index, int force) } int git_index__changed_relative_to( - git_index *index, const git_futils_filestamp *fs) + git_index *index, const git_oid *checksum) { /* attempt to update index (ignoring errors) */ if (git_index_read(index, false) < 0) giterr_clear(); - return (index->stamp.mtime != fs->mtime || - index->stamp.size != fs->size || - index->stamp.ino != fs->ino); + return !!git_oid_cmp(&index->checksum, checksum); } /* diff --git a/src/index.h b/src/index.h index 615d703c4..9c60b015c 100644 --- a/src/index.h +++ b/src/index.h @@ -81,7 +81,7 @@ GIT_INLINE(const git_futils_filestamp *) git_index__filestamp(git_index *index) return &index->stamp; } -extern int git_index__changed_relative_to(git_index *index, const git_futils_filestamp *fs); +extern int git_index__changed_relative_to(git_index *index, const git_oid *checksum); /* Copy the current entries vector *and* increment the index refcount. * Call `git_index__release_snapshot` when done. diff --git a/src/submodule.c b/src/submodule.c index 1139df973..246502e99 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -1946,7 +1946,7 @@ static int submodule_cache_refresh(git_submodule_cache *cache, int refresh) update_index = update_head = update_gitmod = true; else { update_index = - !idx || git_index__changed_relative_to(idx, &cache->index_stamp); + !idx || git_index__changed_relative_to(idx, &cache->index_checksum); update_head = !head || !git_oid_equal(&cache->head_id, git_tree_id(head)); @@ -1984,8 +1984,7 @@ static int submodule_cache_refresh(git_submodule_cache *cache, int refresh) if ((error = submodule_cache_refresh_from_index(cache, idx)) < 0) goto cleanup; - git_futils_filestamp_set( - &cache->index_stamp, git_index__filestamp(idx)); + git_oid_cpy(&cache->index_checksum, git_index_checksum(idx)); } /* add submodule information from HEAD */ diff --git a/src/submodule.h b/src/submodule.h index a6182beca..7a9bf9c92 100644 --- a/src/submodule.h +++ b/src/submodule.h @@ -110,7 +110,7 @@ typedef struct { /* cache invalidation data */ git_oid head_id; - git_futils_filestamp index_stamp; + git_oid index_checksum; git_buf gitmodules_path; git_futils_filestamp gitmodules_stamp; git_futils_filestamp config_stamp; |