зеркало из https://github.com/microsoft/git.git
t3702: fix reliance on SHELL_PATH being '/bin/sh'
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>
This commit is contained in:
Родитель
c59cb03a8b
Коммит
7c8224b6a8
|
@ -21,6 +21,15 @@ who house by the whale-path, heard his mandate,
|
||||||
gave him gifts: a good king he!
|
gave him gifts: a good king he!
|
||||||
EOF
|
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' '
|
test_expect_success 'setup' '
|
||||||
|
|
||||||
git add file &&
|
git add file &&
|
||||||
|
@ -31,10 +40,10 @@ test_expect_success 'setup' '
|
||||||
|
|
||||||
cat > expected-patch << EOF
|
cat > expected-patch << EOF
|
||||||
diff --git a/file b/file
|
diff --git a/file b/file
|
||||||
index b9834b5..0b8f197 100644
|
index b9834b5..9020acb 100644
|
||||||
--- a/file
|
--- a/file
|
||||||
+++ b/file
|
+++ b/file
|
||||||
@@ -1,11 +1,3 @@
|
@@ -1,11 +1,6 @@
|
||||||
-LO, praise of the prowess of people-kings
|
-LO, praise of the prowess of people-kings
|
||||||
-of spear-armed Danes, in days long sped,
|
-of spear-armed Danes, in days long sped,
|
||||||
-we have heard, and what honor the athelings won!
|
-we have heard, and what honor the athelings won!
|
||||||
|
@ -46,9 +55,12 @@ index b9834b5..0b8f197 100644
|
||||||
-till before him the folk, both far and near,
|
-till before him the folk, both far and near,
|
||||||
-who house by the whale-path, heard his mandate,
|
-who house by the whale-path, heard his mandate,
|
||||||
-gave him gifts: a good king he!
|
-gave him gifts: a good king he!
|
||||||
+#!$SHELL_PATH
|
+To him an heir was afterward born,
|
||||||
+mv -f "\$1" orig-patch &&
|
+a son in his halls, whom heaven sent
|
||||||
+mv -f patch "\$1"
|
+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
|
EOF
|
||||||
|
|
||||||
cat > patch << EOF
|
cat > patch << EOF
|
||||||
|
@ -97,9 +109,9 @@ chmod a+x fake-editor.sh
|
||||||
|
|
||||||
test_expect_success 'add -e' '
|
test_expect_success 'add -e' '
|
||||||
|
|
||||||
cp fake-editor.sh file &&
|
cp second-part file &&
|
||||||
git add -e &&
|
git add -e &&
|
||||||
test_cmp fake-editor.sh file &&
|
test_cmp second-part file &&
|
||||||
test_cmp orig-patch expected-patch &&
|
test_cmp orig-patch expected-patch &&
|
||||||
git diff --cached > out &&
|
git diff --cached > out &&
|
||||||
test_cmp out expected
|
test_cmp out expected
|
||||||
|
|
Загрузка…
Ссылка в новой задаче