summaryrefslogtreecommitdiff
path: root/pack-write.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-09-15 20:15:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-15 20:15:27 (GMT)
commit1ea5e46cb96d17c3b3927b4eff9765183cf87f8d (patch)
tree7910465b4f7aee79ff9a6bace72cb8905b72670b /pack-write.c
parent5639a8d1445f8c8d5863b0b80f493adda991e479 (diff)
parent8fe8bae9d28e2b02ceb482ab89ea88bb20556f1d (diff)
downloadgit-1ea5e46cb96d17c3b3927b4eff9765183cf87f8d.zip
git-1ea5e46cb96d17c3b3927b4eff9765183cf87f8d.tar.gz
git-1ea5e46cb96d17c3b3927b4eff9765183cf87f8d.tar.bz2
Merge branch 'ab/reverse-midx-optim'
The code that optionally creates the *.rev reverse index file has been optimized to avoid needless computation when it is not writing the file out. * ab/reverse-midx-optim: pack-write: skip *.rev work when not writing *.rev
Diffstat (limited to 'pack-write.c')
-rw-r--r--pack-write.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pack-write.c b/pack-write.c
index 2767b78..067054f 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -222,6 +222,9 @@ const char *write_rev_file(const char *rev_name,
uint32_t i;
const char *ret;
+ if (!(flags & WRITE_REV) && !(flags & WRITE_REV_VERIFY))
+ return NULL;
+
ALLOC_ARRAY(pack_order, nr_objects);
for (i = 0; i < nr_objects; i++)
pack_order[i] = i;