summaryrefslogtreecommitdiff
path: root/src/libgit2/indexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libgit2/indexer.c')
-rw-r--r--src/libgit2/indexer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libgit2/indexer.c b/src/libgit2/indexer.c
index fa55fb5ea..7357a4aa5 100644
--- a/src/libgit2/indexer.c
+++ b/src/libgit2/indexer.c
@@ -1232,6 +1232,7 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
git_filebuf index_file = {0};
void *packfile_trailer;
size_t checksum_size;
+ int filebuf_hash;
bool mismatch;
if (!idx->parsed_header) {
@@ -1240,6 +1241,7 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
}
checksum_size = git_hash_size(indexer_hash_algorithm(idx));
+ filebuf_hash = git_filebuf_hash_flags(indexer_hash_algorithm(idx));
GIT_ASSERT(checksum_size);
/* Test for this before resolve_deltas(), as it plays with idx->off */
@@ -1314,8 +1316,7 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
return -1;
if (git_filebuf_open(&index_file, filename.ptr,
- GIT_FILEBUF_HASH_CONTENTS |
- (idx->do_fsync ? GIT_FILEBUF_FSYNC : 0),
+ filebuf_hash | (idx->do_fsync ? GIT_FILEBUF_FSYNC : 0),
idx->mode) < 0)
goto on_error;