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

[PATCH] t3702: fix reliance on SHELL_PATH being '/bin/sh'

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 27, 2009, 17:51 UTC
Message-ID
<alpine.DEB.1.00.0904271940100.7741@intel-tinevez-2-302>
In-Reply-To
<e2b179460904270930m3c292bd8l5067447fff330fef@mail.gmail.com>

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>
---
	On Mon, 27 Apr 2009, Mike Ralphson wrote:
	> 2009/4/27 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
	> > On Mon, 27 Apr 2009, Mike Ralphson wrote:
	> >> I'm seeing a reproducible failure in t3702 on AIX 5.3, shell set to
	> >> bash (v2.05b)
	> >>
	> >> The 'test_cmp orig-patch expected-patch' is seeing this diff:
	> >>
	> >> 2c2
	> >> < index b9834b5..52aff4c 100644
	> >> ---
	> >> > index b9834b5..0b8f197 100644
	> >
	> > Could you send me the output of
	> >
	> >        cd t/trash\ directory.t3702* &&
	> >        git show 0b8f197 > file.txt
	Aargh.
	I know what it is.  Sorry, _very_ stupid thinko on this side of 
	the ocean.
	Time for a day off.
 t/t3702-add-edit.sh |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh
index 7262786..4ee47cc 100755
--- a/t/t3702-add-edit.sh
+++ b/t/t3702-add-edit.sh
@@ -21,6 +21,15 @@ who house by the whale-path, heard his mandate,
 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 &&
@@ -31,10 +40,10 @@ test_expect_success 'setup' '
 
 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!
@@ -46,9 +55,12 @@ index b9834b5..0b8f197 100644
 -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
@@ -97,9 +109,9 @@ chmod a+x fake-editor.sh
 
 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
-- 
1.6.2.1.493.g67cf3
Previous: Mike RalphsonNext: Mike Ralphson
Message 4 of 5 in “t3702-add-edit.sh failure in next”
  1. Mike RalphsonApr 27, 2009
  2. Johannes SchindelinApr 27, 2009
  3. Mike RalphsonApr 27, 2009
  4. t3702: fix reliance on SHELL_PATH being '/bin/sh'Johannes Schindelin, Apr 27, 2009
  5. Mike RalphsonApr 27, 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.