diff options
author | Elijah Newren <newren@gmail.com> | 2019-10-22 21:22:49 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-10-23 11:32:48 +0900 |
commit | d3eebaad5ef02284c86d6c4b80199eac58c6729b (patch) | |
tree | c7011e7a5f8a7a7476d25451173554dd5d9e224b /t/t5303-pack-corruption-resilience.sh | |
parent | Eighth batch (diff) | |
download | tgif-d3eebaad5ef02284c86d6c4b80199eac58c6729b.tar.xz |
merge-recursive: clean up get_renamed_dir_portion()
Dscho noted a few things making this function hard to follow.
Restructure it a bit and add comments to make it easier to follow. The
restructurings include:
* There was a special case if-check at the end of the function
checking whether someone just renamed a file within its original
directory, meaning that there could be no directory rename involved.
That check was slightly convoluted; it could be done in a more
straightforward fashion earlier in the function, and can be done
more cheaply too (no call to strncmp).
* The conditions for advancing end_of_old and end_of_new before
calling strchr were both confusing and unnecessary. If either
points at a '/', then they need to be advanced in order to find the
next '/'. If either doesn't point at a '/', then advancing them one
char before calling strchr() doesn't hurt. So, just rip out the
if conditions and advance both before calling strchr().
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5303-pack-corruption-resilience.sh')
0 files changed, 0 insertions, 0 deletions