Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: [PATCH 1/2] t1501: avoid bashisms

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:50:18

2010/12/25 Andreas Schwab [off-list ref]:
Nguyễn Thái Ngọc Duy [off-list ref] writes:
quoted
@@ -322,7 +322,10 @@ test_expect_success 'git grep' '
 test_expect_success 'git commit' '
      (
              cd repo.git &&
-             GIT_DIR=. GIT_WORK_TREE=work git commit -a -m done
In which way is that not portable?
I admit that I rarely leave bash, so I'll quote Johannes answer [1]

-- 8< --
Sure, it is (bashisms). This:

   GIT_DIR="$TRASH_DIRECTORY/2/.git" test_repo 2/sub

does not work the same way in all shells when test_repo is a shell
function. You have to export GIT_DIR explicitly before the function call.
(But since in this case, test_repo invokes its own subshell anyway, you
better do it in the function.)
-- 8< --

[1] http://article.gmane.org/gmane.comp.version-control.git/162207
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help