Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@palantir.com>2022-07-05 04:33:40 +0300
committerJunio C Hamano <gitster@pobox.com>2022-07-06 19:39:46 +0300
commit51e41e4eaf2bd1d0344627d3326a3e20f90f4580 (patch)
treea3f40c775893605a06158bf29ed678f28dc93b7b /merge-ort.c
parent0565cee5e4721c1f991cf9054a2d642a4a72e579 (diff)
merge-ort: small cleanups of check_for_directory_rename
No functional changes, just some preparatory cleanups. Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Elijah Newren <newren@palantir.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-ort.c')
-rw-r--r--merge-ort.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/merge-ort.c b/merge-ort.c
index 8545354daf..ff037cca8d 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -2267,18 +2267,17 @@ static char *check_for_directory_rename(struct merge_options *opt,
struct strmap *collisions,
int *clean_merge)
{
- char *new_path = NULL;
+ char *new_path;
struct strmap_entry *rename_info;
- struct strmap_entry *otherinfo = NULL;
+ struct strmap_entry *otherinfo;
const char *new_dir;
+ /* Cases where we don't have a directory rename for this path */
if (strmap_empty(dir_renames))
- return new_path;
+ return NULL;
rename_info = check_dir_renamed(path, dir_renames);
if (!rename_info)
- return new_path;
- /* old_dir = rename_info->key; */
- new_dir = rename_info->value;
+ return NULL;
/*
* This next part is a little weird. We do not want to do an
@@ -2304,6 +2303,7 @@ static char *check_for_directory_rename(struct merge_options *opt,
* As it turns out, this also prevents N-way transient rename
* confusion; See testcases 9c and 9d of t6043.
*/
+ new_dir = rename_info->value; /* old_dir = rename_info->key; */
otherinfo = strmap_get_entry(dir_rename_exclusions, new_dir);
if (otherinfo) {
path_msg(opt, rename_info->key, 1,