aboutsummaryrefslogtreecommitdiffstats
path: root/commit-graph.c
diff options
context:
space:
mode:
authorGlen Choo <chooglen@google.com>2022-06-30 19:11:53 -0700
committerJunio C Hamano <gitster@pobox.com>2022-06-30 22:41:45 -0700
commitcb49e1e8d342795cbb31c204b5ab744ae9c2e1f3 (patch)
treeb4f6260db9ae5a96d0e363212e4a2446293829e7 /commit-graph.c
parentsubmodule--helper update: use display path helper (diff)
downloadgit-cb49e1e8d342795cbb31c204b5ab744ae9c2e1f3.tar.gz
git-cb49e1e8d342795cbb31c204b5ab744ae9c2e1f3.zip
submodule--helper: don't recreate recursive prefix
update_submodule() uses duplicated code to compute update_data->displaypath and next.recursive_prefix. The latter is just the former with "/" appended to it, and since update_data->displaypath not changed outside of this statement, we can just reuse the already computed result. We can go one step further and remove the reference to next.recursive_prefix altogether. Since it is only used in update_data_to_args() (to compute the "--recursive-prefix" flag for the recursive update child process) we can just use the already computed .displaypath value of there. Delete the duplicated code, and remove the unnecessary reference to next.recursive_prefix. As a bonus, this fixes a memory leak where prefixed_path was never freed (this leak was first reported in [1]). [1] https://lore.kernel.org/git/877a45867ae368bf9e053caedcb6cf421e02344d.1655336146.git.gitgitgadget@gmail.com Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions