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

[PATCH] Extend testing git-mv for renaming of subdirectories

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Jul 26, 2006, 13:44 UTC
Message-ID
<200607261544.08435.Josef.Weidendorfer@gmx.de>
In-Reply-To
<Pine.LNX.4.63.0607260348130.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
---
On Wednesday 26 July 2006 03:52, Johannes Schindelin wrote:
> 	There is no test for it, and I am quite certain the old script
> 	doesn't do it either: git-mv some_tracked_dir/ there/ will
> 	not work. t7001-mv passes, though.

Hmm... Renaming full subtrees worked since the old git-rename days. I just checked it, and it works fine.

My bad, that there was no test for this, so what about this?
Josef
 t/t7001-mv.sh |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index 811a479..9270a41 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -38,4 +38,28 @@ test_expect_success \
     'git-diff-tree -r -M --name-status  HEAD^ HEAD | \
     grep -E "^R100.+path1/COPYING.+path0/COPYING"'
 
+test_expect_success \
+    'adding another file' \
+    'cp ../../README path0/README &&
+     git-add path0/README &&
+     git-commit -m add2 -a'
+
+test_expect_success \
+    'moving whole subdirectory' \
+    'git-mv path0 path2'
+
+test_expect_success \
+    'commiting the change' \
+    'git-commit -m dir-move -a'
+
+test_expect_success \
+    'checking the commit' \
+    'git-diff-tree -r -M --name-status  HEAD^ HEAD | \
+     grep -E "^R100.+path0/COPYING.+path2/COPYING" &&
+     git-diff-tree -r -M --name-status  HEAD^ HEAD | \
+     grep -E "^R100.+path0/README.+path2/README"'
+
 test_done
+
-- 
1.4.2.rc1.g791e
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 4 of 6 in “Make git-mv a builtin”
  1. Make git-mv a builtinJohannes Schindelin, Jul 26, 2006
  2. Junio C HamanoJul 26, 2006
  3. Johannes SchindelinJul 26, 2006
  4. Extend testing git-mv for renaming of subdirectoriesJosef Weidendorfer, Jul 26, 2006
  5. Johannes SchindelinJul 26, 2006
  6. Josef WeidendorferJul 26, 2006

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.