t3030: Add a testcase for resolvable rename/add conflict with symlinks
d5af510 (RE: [PATCH] Avoid rename/add conflict when contents are identical 2010-09-01) avoided erroring out in a rename/add conflict when the contents were identical. A simpler fix could have handled that particular testcase, but it would not correctly handle the case where a symlink is involved. Add another testcase using symlinks, to avoid breaking that case. Signed-off-by: Ken Schalk <ken.schalk@intel.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Schalk, Ken committed
Sep 20, 2010 at 02:28 UTC
8a1c0d322e9b6963f3be6949475983d517d79796
1 file changed
+36
-1
t/t3030-merge-recursive.sh
+36
-1
@@ -25,6 +25,10 @@ test_expect_success 'setup 1' '
25
git branch submod &&
26
git branch copy &&
27
git branch rename &&
28
+ if test_have_prereq SYMLINKS
29
+ then
30
+ git branch rename-ln
31
+ fi &&
32
33
echo hello >>a &&
34
cp a d/e &&
@@ -255,7 +259,16 @@ test_expect_success 'setup 8' '
259
git mv a e &&
260
git add e &&
261
test_tick &&
258
- git commit -m "rename a->e"
262
+ git commit -m "rename a->e" &&
263
+ if test_have_prereq SYMLINKS
264
+ then
265
+ git checkout rename-ln &&
266
+ git mv a e &&
267
+ ln -s e a &&
268
+ git add a e &&
269
+ test_tick &&
270
+ git commit -m "rename a->e, symlink a->e"
271
+ fi
272
'
273
274
test_expect_success 'setup 9' '
@@ -615,4 +628,26 @@ test_expect_success 'merge-recursive copy vs. rename' '
628
test_cmp expected actual
629
'
630
631
+if test_have_prereq SYMLINKS
632
+then
633
+ test_expect_success 'merge-recursive rename vs. rename/symlink' '
634
+
635
+ git checkout -f rename &&
636
+ git merge rename-ln &&
637
+ ( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
638
+ (
639
+ echo "100644 blob $o0 b"
640
+ echo "100644 blob $o0 c"
641
+ echo "100644 blob $o0 d/e"
642
+ echo "100644 blob $o0 e"
643
+ echo "100644 $o0 0 b"
644
+ echo "100644 $o0 0 c"
645
+ echo "100644 $o0 0 d/e"
646
+ echo "100644 $o0 0 e"
647
+ ) >expected &&
648
+ test_cmp expected actual
649
+ '
650
+fi
651
+
652
+
653
test_done