Skip to content

Commit 621ca4c

Browse files
committed
Merge branch 'sk/t1100-modernize' into next
The test script 't/t1100-commit-tree-options.sh' has been modernized by converting test cases to the modern style (using single quotes and tab indentation) and moving the creation of the expected file inside the setup test so it runs under the protection of the test harness. * sk/t1100-modernize: t1100: move creation of expected output into setup test t1100: modernize test style
2 parents 8f30e80 + 9719c29 commit 621ca4c

1 file changed

Lines changed: 28 additions & 30 deletions

File tree

t/t1100-commit-tree-options.sh

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,35 @@ Also make sure that command line parser understands the normal
1414

1515
. ./test-lib.sh
1616

17-
cat >expected <<EOF
18-
tree $EMPTY_TREE
19-
author Author Name <author@email> 1117148400 +0000
20-
committer Committer Name <committer@email> 1117150200 +0000
21-
22-
comment text
23-
EOF
24-
25-
test_expect_success \
26-
'test preparation: write empty tree' \
27-
'git write-tree >treeid'
28-
29-
test_expect_success \
30-
'construct commit' \
31-
'echo comment text |
32-
GIT_AUTHOR_NAME="Author Name" \
33-
GIT_AUTHOR_EMAIL="author@email" \
34-
GIT_AUTHOR_DATE="2005-05-26 23:00" \
35-
GIT_COMMITTER_NAME="Committer Name" \
36-
GIT_COMMITTER_EMAIL="committer@email" \
37-
GIT_COMMITTER_DATE="2005-05-26 23:30" \
38-
TZ=GMT git commit-tree $(cat treeid) >commitid 2>/dev/null'
39-
40-
test_expect_success \
41-
'read commit' \
42-
'git cat-file commit $(cat commitid) >commit'
43-
44-
test_expect_success \
45-
'compare commit' \
46-
'test_cmp expected commit'
17+
test_expect_success 'test preparation: write empty tree' '
18+
cat >expected <<-EOF &&
19+
tree $EMPTY_TREE
20+
author Author Name <author@email> 1117148400 +0000
21+
committer Committer Name <committer@email> 1117150200 +0000
22+
23+
comment text
24+
EOF
25+
git write-tree >treeid
26+
'
27+
28+
test_expect_success 'construct commit' '
29+
echo comment text |
30+
GIT_AUTHOR_NAME="Author Name" \
31+
GIT_AUTHOR_EMAIL="author@email" \
32+
GIT_AUTHOR_DATE="2005-05-26 23:00" \
33+
GIT_COMMITTER_NAME="Committer Name" \
34+
GIT_COMMITTER_EMAIL="committer@email" \
35+
GIT_COMMITTER_DATE="2005-05-26 23:30" \
36+
TZ=GMT git commit-tree $(cat treeid) >commitid 2>/dev/null
37+
'
4738

39+
test_expect_success 'read commit' '
40+
git cat-file commit $(cat commitid) >commit
41+
'
42+
43+
test_expect_success 'compare commit' '
44+
test_cmp expected commit
45+
'
4846

4947
test_expect_success 'flags and then non flags' '
5048
test_tick &&

0 commit comments

Comments
 (0)