summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2024-05-30 02:45:21 -0400
committerJunio C Hamano <gitster@pobox.com>2024-05-30 08:55:29 -0700
commitd58a687705d3920464c786b4f7b837d620f8d8b1 (patch)
tree56c54f8a62f0cd6519fe0295c4cab3558f351801 /commit-graph.c
parentcc65e085e413c7b837e46169ff543c6c8bfcae1f (diff)
mv: factor out empty src_dir removal
This pulls the loop added by b6f51e3db9 (mv: cleanup empty WORKING_DIRECTORY, 2022-08-09) into a sub-function. That reduces clutter in cmd_mv() and makes it easier to see that the lifetime of the a_src_dir strbuf is limited to this code (and thus its cleanup doesn't need to go after the "out" label). Another option would be to just declare the strbuf inside the loop, since it is only used there. But this refactor retains the existing property that we can reuse the allocated buffer for each iteration of the loop. That optimization is probably overkill, but I think the sub-function is more readable anyway, and then keeping the optimization is basically free. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions