summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c59cb03)
raw | patch | inline | side by side (parent: c59cb03)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Mon, 27 Apr 2009 17:51:42 +0000 (19:51 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 28 Apr 2009 01:23:55 +0000 (18:23 -0700) |
Trying to be lazy and comparing files with fake-editor.sh to avoid
having to provide another example text does not work well: the blob
name changes when SHELL_PATH changes, and so does the 'index' line
in the diff.
Therefore provide a second example text.
Noticed by Mike Ralphson.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
having to provide another example text does not work well: the blob
name changes when SHELL_PATH changes, and so does the 'index' line
in the diff.
Therefore provide a second example text.
Noticed by Mike Ralphson.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3702-add-edit.sh | patch | blob | history |
diff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh
index 72627863e5a9d00c758bcf96820a89827d310ba7..4ee47cc9a862cdbe8c63bc9d4ebbe46ff3c344bc 100755 (executable)
--- a/t/t3702-add-edit.sh
+++ b/t/t3702-add-edit.sh
gave him gifts: a good king he!
EOF
+cat > second-part << EOF
+To him an heir was afterward born,
+a son in his halls, whom heaven sent
+to favor the folk, feeling their woe
+that erst they had lacked an earl for leader
+so long a while; the Lord endowed him,
+the Wielder of Wonder, with world's renown.
+EOF
+
test_expect_success 'setup' '
git add file &&
cat > expected-patch << EOF
diff --git a/file b/file
-index b9834b5..0b8f197 100644
+index b9834b5..9020acb 100644
--- a/file
+++ b/file
-@@ -1,11 +1,3 @@
+@@ -1,11 +1,6 @@
-LO, praise of the prowess of people-kings
-of spear-armed Danes, in days long sped,
-we have heard, and what honor the athelings won!
-till before him the folk, both far and near,
-who house by the whale-path, heard his mandate,
-gave him gifts: a good king he!
-+#!$SHELL_PATH
-+mv -f "\$1" orig-patch &&
-+mv -f patch "\$1"
++To him an heir was afterward born,
++a son in his halls, whom heaven sent
++to favor the folk, feeling their woe
++that erst they had lacked an earl for leader
++so long a while; the Lord endowed him,
++the Wielder of Wonder, with world's renown.
EOF
cat > patch << EOF
test_expect_success 'add -e' '
- cp fake-editor.sh file &&
+ cp second-part file &&
git add -e &&
- test_cmp fake-editor.sh file &&
+ test_cmp second-part file &&
test_cmp orig-patch expected-patch &&
git diff --cached > out &&
test_cmp out expected