t7900-subtree.sh: fix quoting and broken && chains

Allow whitespace in arguments to subtree_test_create_repo. Add missing && chains. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Aguilar committed Jul 25, 2016 at 21:14 UTC fbd3199a6d8c6b3fd1e9aa0034cee9a0c6a9bfb4
1 file changed +8 -8
contrib/subtree/t/t7900-subtree.sh
+8 -8
@@ -16,16 +16,16 @@ export TEST_DIRECTORY
16
17 subtree_test_create_repo()
18 {
19 - test_create_repo "$1"
19 + test_create_repo "$1" &&
20 (
21 - cd $1
21 + cd "$1" &&
22 git config log.date relative
23 )
24 }
25
26 create()
27 {
28 - echo "$1" >"$1"
28 + echo "$1" >"$1" &&
29 git add "$1"
30 }
31
@@ -71,12 +71,12 @@ join_commits()
71 }
72
73 test_create_commit() (
74 - repo=$1
75 - commit=$2
76 - cd "$repo"
77 - mkdir -p $(dirname "$commit") \
74 + repo=$1 &&
75 + commit=$2 &&
76 + cd "$repo" &&
77 + mkdir -p "$(dirname "$commit")" \
78 || error "Could not create directory for commit"
79 - echo "$commit" >"$commit"
79 + echo "$commit" >"$commit" &&
80 git add "$commit" || error "Could not add commit"
81 git commit -m "$commit" || error "Could not commit"
82 )