Thread (3 messages) flat view 3 messages, 1 author, 2016-06-15
DORMANTno replies

[PATCH 2/2] merge-recursive: Fix multiple file rename across D/F conflict

From: Elijah Newren <hidden>
Date: 2016-06-15 22:49:20
Subsystem: the rest · Maintainer: Linus Torvalds

In 5a2580d (merge_recursive: Fix renames across paths below D/F conflicts
2010-07-09), detection was added for renames across paths involved in a
directory<->file conflict.  However, the change accidentally involved
reusing an outer loop index ('i') in an inner loop, changing its values
and causing a slightly different type of breakage for cases where there are
multiple renames across the D/F conflict.  Fix by creating a new temporary
variable 'i'.

Signed-off-by: Elijah Newren <redacted>
---
I'm really embarrased about this one...  :-/

 merge-recursive.c          |    1 +
 t/t6031-merge-recursive.sh |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index af53b2a..f413e9f 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1018,6 +1018,7 @@ static int process_renames(struct merge_options *o,
 				if (mfi.clean &&
 				    sha_eq(mfi.sha, ren1->pair->two->sha1) &&
 				    mfi.mode == ren1->pair->two->mode) {
+					int i;
 					/*
 					 * This messaged is part of
 					 * t6022 test. If you change
diff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh
index aa235b9..25ae637 100755
--- a/t/t6031-merge-recursive.sh
+++ b/t/t6031-merge-recursive.sh
@@ -57,7 +57,7 @@ test_expect_success FILEMODE 'verify executable bit on file' '
 	test -x file2
 '
 
-test_expect_failure 'merging with triple rename across D/F conflict' '
+test_expect_success 'merging with triple rename across D/F conflict' '
 	git reset --hard HEAD &&
 	git checkout --orphan main &&
 	git rm -rf . &&
-- 
1.7.2.1.227.g086c8
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help