diff options
Diffstat (limited to 'csum-file.c')
-rw-r--r-- | csum-file.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/csum-file.c b/csum-file.c index cce13c0f04..870748e016 100644 --- a/csum-file.c +++ b/csum-file.c @@ -7,9 +7,10 @@ * files. Useful when you write a file that you want to be * able to verify hasn't been messed with afterwards. */ -#include "cache.h" +#include "git-compat-util.h" #include "progress.h" #include "csum-file.h" +#include "hash.h" static void verify_buffer_or_die(struct hashfile *f, const void *buf, @@ -206,7 +207,7 @@ int hashfile_truncate(struct hashfile *f, struct hashfile_checkpoint *checkpoint lseek(f->fd, offset, SEEK_SET) != offset) return -1; f->total = offset; - f->ctx = checkpoint->ctx; + the_hash_algo->clone_fn(&f->ctx, &checkpoint->ctx); f->offset = 0; /* hashflush() was called in checkpoint */ return 0; } |