1#!/bin/sh 2# 3# Copyright (c) 2005 Junio C Hamano 4# 5 6test_description='More rename detection tests. 7 8The rename detection logic should be able to detect pure rename or 9copy of symbolic links, but should not produce rename/copy followed 10by an edit for them. 11' 12. ./test-lib.sh 13 14test_expect_success \ 15'prepare reference tree' \ 16'echo xyzzy | tr -d '\\\\'012 >yomin && 17 ln -s xyzzy frotz && 18 git-update-cache --add frotz yomin && 19 tree=$(git-write-tree)&& 20 echo$tree' 21 22test_expect_success \ 23'prepare work tree' \ 24'mv frotz rezrov && 25 rm -f yomin && 26 ln -s xyzzy nitfol && 27 ln -s xzzzy bozbar && 28 git-update-cache --add --remove frotz rezrov nitfol bozbar yomin' 29 30# tree has frotz pointing at xyzzy, and yomin that contains xyzzy to 31# confuse things. work tree has rezrov (xyzzy) nitfol (xyzzy) and 32# bozbar (xzzzy). 33# rezrov and nitfol are rename/copy of frotz and bozbar should be 34# a new creation. 35 36GIT_DIFF_OPTS=--unified=0 git-diff-cache -M -p$tree>current 37cat>expected <<\EOF 38diff--git a/frotz b/nitfol 39similarity index 100% 40copy from frotz 41copy to nitfol 42diff--git a/frotz b/rezrov 43similarity index 100% 44rename old frotz 45rename new rezrov 46diff--git a/yomin b/yomin 47deleted file mode 100644 48--- a/yomin 49+++ /dev/null 50@@ -1+0,0 @@ 51-xyzzy 52\ No newline at end of file 53diff--git a/bozbar b/bozbar 54new file mode 120000 55---/dev/null 56+++ b/bozbar 57@@ -0,0+1 @@ 58+xzzzy 59\ No newline at end of file 60EOF 61 62test_expect_success \ 63'validate diff output' \ 64'diff -u current expected' 65 66test_done