]> git.ipfire.org Git - thirdparty/git.git/blame - t/t1100-commit-tree-options.sh
Merge branch 'jc/maint-am-keep'
[thirdparty/git.git] / t / t1100-commit-tree-options.sh
CommitLineData
c504aae2
RS
1#!/bin/sh
2#
3# Copyright (C) 2005 Rene Scharfe
4#
5
5be60078 6test_description='git commit-tree options test
c504aae2 7
5be60078 8This test checks that git commit-tree can create a specific commit
c504aae2
RS
9object by defining all environment variables that it understands.
10'
11
12. ./test-lib.sh
13
14cat >expected <<EOF
15tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
16author Author Name <author@email> 1117148400 +0000
17committer Committer Name <committer@email> 1117150200 +0000
18
19comment text
20EOF
21
22test_expect_success \
23 'test preparation: write empty tree' \
5be60078 24 'git write-tree >treeid'
c504aae2
RS
25
26test_expect_success \
27 'construct commit' \
28 'echo comment text |
29 GIT_AUTHOR_NAME="Author Name" \
30 GIT_AUTHOR_EMAIL="author@email" \
31 GIT_AUTHOR_DATE="2005-05-26 23:00" \
32 GIT_COMMITTER_NAME="Committer Name" \
33 GIT_COMMITTER_EMAIL="committer@email" \
34 GIT_COMMITTER_DATE="2005-05-26 23:30" \
5be60078 35 TZ=GMT git commit-tree `cat treeid` >commitid 2>/dev/null'
c504aae2
RS
36
37test_expect_success \
38 'read commit' \
5be60078 39 'git cat-file commit `cat commitid` >commit'
c504aae2
RS
40
41test_expect_success \
42 'compare commit' \
188c3827 43 'test_cmp expected commit'
c504aae2
RS
44
45test_done