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

[PATCH] tests: test applying criss-cross rename patch

From
Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Date
Apr 11, 2009, 15:26 UTC
Message-ID
<1239463584-1427-1-git-send-email-michal.kiedrowicz@gmail.com>
In-Reply-To
<alpine.LFD.2.00.0904091147290.4583@localhost.localdomain>
Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
---
 t/t4130-apply-criss-cross-rename.sh |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100755 t/t4130-apply-criss-cross-rename.sh
diff --git a/t/t4130-apply-criss-cross-rename.sh b/t/t4130-apply-criss-cross-rename.sh
new file mode 100755
index 0000000..30187ff
--- /dev/null
+++ b/t/t4130-apply-criss-cross-rename.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+test_description='git apply handling criss-cross rename patch.'
+. ./test-lib.sh
+
+create_file() {
+	for ((i=0; i<100; i++)); do
+		echo "$2" >> "$1"
+	done
+}
+
+test_expect_success 'setup' '
+	create_file file1 "File1 contents" &&
+	create_file file2 "File2 contents" &&
+	git add file1 file2 &&
+	git commit -m 1
+'
+
+test_expect_success 'criss-cross rename' '
+	mv file1 tmp &&
+	mv file2 file1 &&
+	mv tmp file2
+'
+
+test_expect_success 'diff -M -B' '
+	git diff -M -B > diff &&
+	git reset --hard
+
+'
+
+test_expect_failure 'apply' '
+	git apply diff
+'
+
+test_done
-- 
1.6.0.6
Previous: Linus TorvaldsNext: Junio C Hamano
Message 2 of 7 in “buglet: 'git apply' doesn't handle criss-cross renames”
  1. Linus TorvaldsApr 9, 2009
  2. tests: test applying criss-cross rename patchMichał Kiedrowicz, Apr 11, 2009
  3. Junio C HamanoApr 13, 2009
  4. Junio C HamanoApr 13, 2009
  5. Alex RiesenApr 20, 2009
  6. Junio C HamanoApr 21, 2009
  7. Alex RiesenApr 21, 2009

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.