summaryrefslogtreecommitdiff
path: root/tree.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-09-09 23:24:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-10 01:23:11 (GMT)
commit8737dab3463b40120c249f8f64854326f32618ec (patch)
tree4422e5e083d52218bdf22d5d542c53e0dae17d7c /tree.h
parent4e58cedd948cf9bdf0e0c09dd312d1d9c1b035c0 (diff)
downloadgit-8737dab3463b40120c249f8f64854326f32618ec.zip
git-8737dab3463b40120c249f8f64854326f32618ec.tar.gz
git-8737dab3463b40120c249f8f64854326f32618ec.tar.bz2
index-pack: refactor renaming in final()
Refactor the renaming in final() into a helper function, this is similar in spirit to a preceding refactoring of finish_tmp_packfile() in pack-write.c. Before e37d0b8730b (builtin/index-pack.c: write reverse indexes, 2021-01-25) it probably wasn't worth it to have this sort of helper, due to the differing "else if" case for "pack" files v.s. "idx" files. But since we've got "rev" as well now, let's do the renaming via a helper, this is both a net decrease in lines, and improves the readability, since we can easily see at a glance that the logic for writing these three types of files is exactly the same, aside from the obviously differing cases of "*final_name" being NULL, and "make_read_only_if_same" being different. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree.h')
0 files changed, 0 insertions, 0 deletions