t1302: use "git -C"
This is shorter, and saves a subshell. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Sep 12, 2016 at 20:24 UTC
11ca4bec96e00f7ed18dbd2a475a8d568f4b85f3
1 file changed
+6
-24
t/t1302-repo-version.sh
+6
-24
@@ -25,10 +25,7 @@ test_expect_success 'setup' '
25
test_expect_success 'gitdir selection on normal repos' '
26
echo 0 >expect &&
27
git config core.repositoryformatversion >actual &&
28
- (
29
- cd test &&
30
- git config core.repositoryformatversion >../actual2
31
- ) &&
28
+ git -C test config core.repositoryformatversion >actual2 &&
29
test_cmp expect actual &&
30
test_cmp expect actual2
31
'
@@ -36,35 +33,20 @@ test_expect_success 'gitdir selection on normal repos' '
33
test_expect_success 'gitdir selection on unsupported repo' '
34
# Make sure it would stop at test2, not trash
35
echo 99 >expect &&
39
- (
40
- cd test2 &&
41
- git config core.repositoryformatversion >../actual
42
- ) &&
36
+ git -C test2 config core.repositoryformatversion >actual &&
37
test_cmp expect actual
38
'
39
40
test_expect_success 'gitdir not required mode' '
41
git apply --stat test.patch &&
48
- (
49
- cd test &&
50
- git apply --stat ../test.patch
51
- ) &&
52
- (
53
- cd test2 &&
54
- git apply --stat ../test.patch
55
- )
42
+ git -C test apply --stat ../test.patch &&
43
+ git -C test2 apply --stat ../test.patch
44
'
45
46
test_expect_success 'gitdir required mode' '
47
git apply --check --index test.patch &&
60
- (
61
- cd test &&
62
- git apply --check --index ../test.patch
63
- ) &&
64
- (
65
- cd test2 &&
66
- test_must_fail git apply --check --index ../test.patch
67
- )
48
+ git -C test apply --check --index ../test.patch &&
49
+ test_must_fail git -C test2 apply --check --index ../test.patch
50
'
51
52
check_allow () {