git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [PATCH 2/3] merge-recursive: Small code cleanup

From
SKSchalk, Ken <ken.schalk@intel.com>
Date
Sep 9, 2010, 20:23 UTC
Message-ID
<EF9FEAB3A4B7D245B0801936B6EF4A25593A57@azsmsx503.amr.corp.intel.com>
In-Reply-To
<AANLkTim5AA7mnAhkbqJaFcUv9vniTVG7siOMxE+y=ehf@mail.gmail.com>
>Perhaps you could submit another patch changing your testcase back to
>using a symlink to make sure someone like me doesn't break your
>original testcase in the future?
Here's a patch relative to my last one.  Rather than restoring the previous test, I added it so that platforms with no symlink support can still test copy vs. rename and platforms with symlink support can also test rename vs. rename/symlink.
Signed-off-by: Ken Schalk <ken.schalk@intel.com>
---
 t/t3030-merge-recursive.sh |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index b23bd9f..9514ae2 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -25,6 +25,10 @@ test_expect_success 'setup 1' '
        git branch submod &&
        git branch copy &&
        git branch rename &&
+       if test_have_prereq SYMLINKS
+       then
+               git branch rename-ln
+       fi &&

        echo hello >>a &&
        cp a d/e &&
@@ -256,7 +260,17 @@ test_expect_success 'setup 8' '
        git mv a e &&
        git add e &&
        test_tick &&
-       git commit -m "rename a->e"
+       git commit -m "rename a->e" &&
+       if test_have_prereq SYMLINKS
+       then
+               git checkout rename-ln &&
+               git mv a e &&
+               ln -s e a &&
+               git add a e &&
+               test_tick &&
+               git commit -m "rename a->e, symlink a->e"
+       fi
+
 '

 test_expect_success 'setup 9' '
@@ -618,5 +632,25 @@ test_expect_success 'merge-recursive copy vs. rename' '
        test_cmp expected actual
 '

+if test_have_prereq SYMLINKS
+then
+       test_expect_success 'merge-recursive rename vs. rename/symlink' '
+
+               git checkout -f rename &&
+               git merge rename-ln &&
+               ( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
+               (
+                       echo "100644 blob $o0   b"
+                       echo "100644 blob $o0   c"
+                       echo "100644 blob $o0   d/e"
+                       echo "100644 blob $o0   e"
+                       echo "100644 $o0 0      b"
+                       echo "100644 $o0 0      c"
+                       echo "100644 $o0 0      d/e"
+                       echo "100644 $o0 0      e"
+               ) >expected &&
+               test_cmp expected actual
+       '
+fi

 test_done
--
1.7.0
Previous: Elijah NewrenNext: Camille Moncelier
Message 12 of 14 in “cherry-picking a commit clobbers a file which is a directory in the target commit”
  1. NickSep 2, 2010
  2. NickSep 6, 2010
  3. Elijah NewrenSep 6, 2010
  4. 0/3 Fix resolvable rename + D/F conflict testcasesElijah Newren, Sep 6, 2010
  5. Elijah NewrenSep 6, 2010
  6. 1/3 t3509: Add rename + D/F conflict testcases that recursive strategy failsElijah Newren, Sep 6, 2010
  7. 2/3 merge-recursive: Small code cleanupElijah Newren, Sep 6, 2010
  8. Elijah NewrenSep 6, 2010
  9. Junio C HamanoSep 6, 2010
  10. Schalk, KenSep 7, 2010
  11. Elijah NewrenSep 8, 2010
  12. Schalk, KenSep 9, 2010
  13. Camille MoncelierOct 21, 2010
  14. 3/3 merge-recursive: D/F conflicts where was_a_dir/file -> was_a_dirElijah Newren, Sep 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.