3 # Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>
6 # FIXME: Test the various index usages, -i and -o, test reflog,
9 test_description='git-commit'
16 "echo 'bongo bongo' >file &&
18 git-status | grep 'Initial commit'"
21 "fail initial amend" \
26 "git-commit -m initial"
30 "git-commit -m foo -m bar -F file"
34 "git-commit -C HEAD -m illegal"
37 "using invalid commit with -C" \
41 "testing nothing to commit" \
42 "git-commit -m initial"
46 "echo 'bongo bongo bongo' >file \
47 git-commit -m next -a"
50 "commit message from non-existing file" \
51 "echo 'more bongo: bongo bongo bongo bongo' >file && \
54 # Empty except stray tabs and spaces on a few lines.
55 sed -e 's/@$//' >msg <<EOF
62 "empty commit message" \
63 "git-commit -F msg -a"
66 "commit message from file" \
67 "echo 'this is the commit message, coming from a file' >msg && \
72 sed -i -e "s/a file/an amend commit/g" $1
78 "VISUAL=./editor git-commit --amend"
82 "echo 'enough with the bongos' >file && \
83 git-commit -F msg -m amending ."
86 "using message from other commit" \
87 "git-commit -C HEAD^ ."
91 sed -i -e "s/amend/older/g" $1
96 "editing message from other commit" \
97 "echo 'hula hula' >file && \
98 VISUAL=./editor git-commit -c HEAD^ -a"
100 test_expect_success \
101 "message from stdin" \
102 "echo 'silly new contents' >file && \
103 echo commit message from stdin | git-commit -F - -a"
105 test_expect_success \
106 "overriding author from command line" \
107 "echo 'gak' >file && \
108 git-commit -m 'author' --author 'Rubber Duck <rduck@convoy.org>' -a"
110 test_expect_success \
112 "echo 7 | git-commit --interactive | grep 'What now'"
114 test_expect_success \
115 "showing committed revisions" \
116 "git-rev-list HEAD >current"
118 # We could just check the head sha1, but checking each commit makes it
119 # easier to isolate bugs.
122 72c0dc9855b0c9dadcbfd5a31cab072e0cb774ca
123 9b88fc14ce6b32e3d9ee021531a54f18a5cf38a2
124 3536bbb352c3a1ef9a420f5b4242d48578b92aa7
125 d381ac431806e53f3dd7ac2f1ae0534f36d738b9
126 4fd44095ad6334f3ef72e4c5ec8ddf108174b54a
127 402702b49136e7587daa9280e91e4bb7cb2179f7
130 test_expect_success \
131 'validate git-rev-list output.' \
132 'diff current expected'