summaryrefslogtreecommitdiff
path: root/t/t4005-diff-rename-2.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-24 08:10:48 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-24 08:26:26 (GMT)
commit25d5ea410fd528c13e5f56f7836ee8a3b839b168 (patch)
tree06e98a3d7cfef4675801dacaffc8aad0d251398a /t/t4005-diff-rename-2.sh
parent1e3f6b6e64511491d86ac7ce447ee26cea362d12 (diff)
downloadgit-25d5ea410fd528c13e5f56f7836ee8a3b839b168.zip
git-25d5ea410fd528c13e5f56f7836ee8a3b839b168.tar.gz
git-25d5ea410fd528c13e5f56f7836ee8a3b839b168.tar.bz2
[PATCH] Redo rename/copy detection logic.
Earlier implementation had a major screw-up in the memory management area. Rename/copy logic sometimes borrowed a pointer to a structure without any provision for downstream to determine which pointer is shared and which is not. This resulted in the later clean-up code to sometimes double free such structure, resulting in a segfault. This made -M and -C useless. Another problem the earlier implementation had was that it reordered the patches, and forced the logic to differentiate renames and copies to depend on that particular order. This problem was fixed by teaching rename/copy detection logic not to do any reordering, and rename-copy differentiator not to depend on the order of the patches. The diffs will leave rename/copy detector in the same destination path order as the patch that was fed into it. Some test vectors have been reordered to accommodate this change. It also adds a sanity check logic to the human-readable diff-raw output to detect paths with embedded TAB and LF characters, which cannot be expressed with that format. This idea came up during a discussion with Chris Wedgwood. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 't/t4005-diff-rename-2.sh')
-rw-r--r--t/t4005-diff-rename-2.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh
index 24d5365..a519855 100644
--- a/t/t4005-diff-rename-2.sh
+++ b/t/t4005-diff-rename-2.sh
@@ -101,8 +101,8 @@ test_expect_success \
git-diff-cache -C $tree >current
cat >expected <<\EOF
-:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0603b3238a076dc6c8022aedc6648fa523a17178 C1234 COPYING COPYING.1
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 06c67961bbaed34a127f76d261f4c0bf73eda471 M COPYING
+:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0603b3238a076dc6c8022aedc6648fa523a17178 C1234 COPYING COPYING.1
EOF
test_expect_success \
@@ -118,14 +118,6 @@ test_expect_success \
mv expected diff-raw
GIT_DIFF_OPTS=--unified=0 git-diff-helper <diff-raw >current
cat >expected <<\EOF
-diff --git a/COPYING b/COPYING.1
-copy from COPYING
-copy to COPYING.1
---- a/COPYING
-+++ b/COPYING.1
-@@ -6 +6 @@
-- HOWEVER, in order to allow a migration to GPLv3 if that seems like
-+ However, in order to allow a migration to GPLv3 if that seems like
diff --git a/COPYING b/COPYING
--- a/COPYING
+++ b/COPYING
@@ -138,6 +130,14 @@ diff --git a/COPYING b/COPYING
@@ -12 +12 @@
- This file is licensed under the GPL v2, or a later version
+ This file is licensed under the G.P.L v2, or a later version
+diff --git a/COPYING b/COPYING.1
+copy from COPYING
+copy to COPYING.1
+--- a/COPYING
++++ b/COPYING.1
+@@ -6 +6 @@
+- HOWEVER, in order to allow a migration to GPLv3 if that seems like
++ However, in order to allow a migration to GPLv3 if that seems like
EOF
test_expect_success \