@@ -134,8 +134,8 @@ cat >ls.expected <<EOF
134134100644 $ONE_SHA1 0 me
135135EOF
136136
137- export GIT_DIR=" $TRASH_DIRECTORY /.git"
138- export GIT_WORK_TREE=/
137+ GIT_DIR=" $TRASH_DIRECTORY /.git" && export GIT_DIR
138+ GIT_WORK_TREE=/ && export GIT_WORK_TREE
139139
140140test_vars ' abs gitdir, root' " $GIT_DIR " " /" " "
141141test_foobar_root
@@ -154,24 +154,24 @@ say "GIT_DIR relative, GIT_WORK_TREE set"
154154
155155test_expect_success ' go to /' ' cd /'
156156
157- export GIT_DIR=" $( echo $TRASH_DIRECTORY | sed ' s,^/,,' ) /.git"
158- export GIT_WORK_TREE=/
157+ GIT_DIR=" $( echo $TRASH_DIRECTORY | sed ' s,^/,,' ) /.git" && export GIT_DIR
158+ GIT_WORK_TREE=/ && export GIT_WORK_TREE
159159
160160test_vars ' rel gitdir, root' " $GIT_DIR " " /" " "
161161test_foobar_root
162162
163163test_expect_success ' go to /foo' ' cd /foo'
164164
165- export GIT_DIR=" ../$TRASH_DIRECTORY /.git"
166- export GIT_WORK_TREE=/
165+ GIT_DIR=" ../$TRASH_DIRECTORY /.git" && export GIT_DIR
166+ GIT_WORK_TREE=/ && export GIT_WORK_TREE
167167
168168test_vars ' rel gitdir, foo' " $TRASH_DIRECTORY /.git" " /" " foo/"
169169test_foobar_foo
170170
171171test_expect_success ' go to /foo/bar' ' cd /foo/bar'
172172
173- export GIT_DIR=" ../../$TRASH_DIRECTORY /.git"
174- export GIT_WORK_TREE=/
173+ GIT_DIR=" ../../$TRASH_DIRECTORY /.git" && export GIT_DIR
174+ GIT_WORK_TREE=/ && export GIT_WORK_TREE
175175
176176test_vars ' rel gitdir, foo/bar' " $TRASH_DIRECTORY /.git" " /" " foo/bar/"
177177test_foobar_foobar
@@ -180,24 +180,24 @@ say "GIT_DIR relative, GIT_WORK_TREE relative"
180180
181181test_expect_success ' go to /' ' cd /'
182182
183- export GIT_DIR=" $( echo $TRASH_DIRECTORY | sed ' s,^/,,' ) /.git"
184- export GIT_WORK_TREE=.
183+ GIT_DIR=" $( echo $TRASH_DIRECTORY | sed ' s,^/,,' ) /.git" && export GIT_DIR
184+ GIT_WORK_TREE=. && export GIT_WORK_TREE
185185
186186test_vars ' rel gitdir, root' " $GIT_DIR " " /" " "
187187test_foobar_root
188188
189189test_expect_success ' go to /' ' cd /foo'
190190
191- export GIT_DIR=" ../$TRASH_DIRECTORY /.git"
192- export GIT_WORK_TREE=..
191+ GIT_DIR=" ../$TRASH_DIRECTORY /.git" && export GIT_DIR
192+ GIT_WORK_TREE=.. && export GIT_WORK_TREE
193193
194194test_vars ' rel gitdir, foo' " $TRASH_DIRECTORY /.git" " /" " foo/"
195195test_foobar_foo
196196
197197test_expect_success ' go to /foo/bar' ' cd /foo/bar'
198198
199- export GIT_DIR=" ../../$TRASH_DIRECTORY /.git"
200- export GIT_WORK_TREE=../..
199+ GIT_DIR=" ../../$TRASH_DIRECTORY /.git" && export GIT_DIR
200+ GIT_WORK_TREE=../.. && export GIT_WORK_TREE
201201
202202test_vars ' rel gitdir, foo/bar' " $TRASH_DIRECTORY /.git" " /" " foo/bar/"
203203test_foobar_foobar
0 commit comments