[PATCH] t4116-apply-reverse.sh: use $TAR rather than tar

Subsystems: the rest

STALE3738d

6 messages, 4 authors, 2016-06-15 · open the first message on its own page

[PATCH] t4116-apply-reverse.sh: use $TAR rather than tar

From: Brandon Casey <hidden>
Date: 2016-06-15 22:44:59

Signed-off-by: Brandon Casey <redacted>
---
 t/t4116-apply-reverse.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh
index 1459a90..2298ece 100755
--- a/t/t4116-apply-reverse.sh
+++ b/t/t4116-apply-reverse.sh
@@ -48,12 +48,12 @@ test_expect_success 'apply in reverse' '
 
 test_expect_success 'setup separate repository lacking postimage' '
 
-	git tar-tree initial initial | tar xf - &&
+	git tar-tree initial initial | $TAR xf - &&
 	(
 		cd initial && git init && git add .
 	) &&
 
-	git tar-tree second second | tar xf - &&
+	git tar-tree second second | $TAR xf - &&
 	(
 		cd second && git init && git add .
 	)
-- 
1.6.0.rc0.38.g8b8fb7

[PATCH] Set TAR in t/Makefile and in t4116-apply-reverse.sh

From: Stephan Beyer <hidden>
Date: 2016-06-15 22:45:02

Hence, the test passes also when you run "make" in t/
or when you invoke t4116-apply-reverse.sh directly,
without $TAR being set.

Signed-off-by: Stephan Beyer <redacted>
---
 t/Makefile               |    2 +-
 t/t4116-apply-reverse.sh |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/t/Makefile b/t/Makefile
index 0d65ced..b720943 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -5,7 +5,7 @@
 
 #GIT_TEST_OPTS=--verbose --debug
 SHELL_PATH ?= $(SHELL)
-TAR ?= $(TAR)
+TAR ?= tar
 RM ?= rm -f
 
 # Shell quote;
diff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh
index 2298ece..3ff5d9e 100755
--- a/t/t4116-apply-reverse.sh
+++ b/t/t4116-apply-reverse.sh
@@ -8,6 +8,7 @@ test_description='git apply in reverse
 '
 
 . ./test-lib.sh
+TAR=${TAR:-tar}
 
 test_expect_success setup '
 
-- 
1.6.0.rc0.102.ga1791

Re: [PATCH] Set TAR in t/Makefile and in t4116-apply-reverse.sh

From: Miklos Vajna <hidden>
Date: 2016-06-15 22:45:02

On Fri, Jul 25, 2008 at 06:37:40PM +0200, Stephan Beyer [off-list ref] wrote:
Hence, the test passes also when you run "make" in t/
or when you invoke t4116-apply-reverse.sh directly,
without $TAR being set.
Thanks, I just hit this issue today. ;-)

Re: [PATCH] Set TAR in t/Makefile and in t4116-apply-reverse.sh

From: Stephan Beyer <hidden>
Date: 2016-06-15 22:45:02

Hi,

Miklos Vajna wrote:
On Fri, Jul 25, 2008 at 06:37:40PM +0200, Stephan Beyer [off-list ref] wrote:
quoted
Hence, the test passes also when you run "make" in t/
or when you invoke t4116-apply-reverse.sh directly,
without $TAR being set.
Thanks, I just hit this issue today. ;-)
Puh, I'm glad that you're not writing
"I've hit this issue yesterday and already sent a patch to this list" :)

Regards,
  Stephan

-- 
Stephan Beyer [off-list ref], PGP 0x6EDDD207FCC5040F

Re: [PATCH] Set TAR in t/Makefile and in t4116-apply-reverse.sh

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:02

Actually, 455a7f3 (More portability., 2005-09-30) introduced $TAR and it
is also used in t5000.  cb34882 (fix t5000-tar-tree.sh when $TAR isn't
set, 2005-11-08) did the same fix you are adding, but I think both of
these fixes are in a wrong place.

I think we should do this instead.  That's how SHELL_PATH is passed around
from build to all the test scripts already.

---
 Makefile            |    1 +
 t/t5000-tar-tree.sh |    1 -
 2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index b003e3e..1d14209 100644
--- a/Makefile
+++ b/Makefile
@@ -1212,6 +1212,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS
 
 GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
 	@echo SHELL_PATH=\''$(SHELL_PATH_SQ)'\' >$@
+	@echo TAR=\''$(subst ','\'',$(TAR))'\' >>$@
 
 ### Detect Tck/Tk interpreter path changes
 ifndef NO_TCLTK
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 9b0baac..5eb119e 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -25,7 +25,6 @@ commit id embedding:
 '
 
 . ./test-lib.sh
-TAR=${TAR:-tar}
 UNZIP=${UNZIP:-unzip}
 
 SUBSTFORMAT=%H%n

Re: [PATCH] Set TAR in t/Makefile and in t4116-apply-reverse.sh

From: Stephan Beyer <hidden>
Date: 2016-06-15 22:45:02

Hi,
quoted hunk
diff --git a/Makefile b/Makefile
index b003e3e..1d14209 100644
--- a/Makefile
+++ b/Makefile
@@ -1212,6 +1212,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS
 
 GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
 	@echo SHELL_PATH=\''$(SHELL_PATH_SQ)'\' >$@
+	@echo TAR=\''$(subst ','\'',$(TAR))'\' >>$@
 
 ### Detect Tck/Tk interpreter path changes
 ifndef NO_TCLTK
But then TAR has to be set in test-lib.sh also, to be able to
invoke t5000 and t4116 directly, hasn't it?

Regards.

-- 
Stephan Beyer [off-list ref], PGP 0x6EDDD207FCC5040F
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help