[PATCH] Extend testing git-mv for renaming of subdirectories
- From
- Josef 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