@matheusbsbs / matheus-bagliano / commits / 9c7466fa24
Fork 0

Verify git-commit provides a reflog message.

The reflog message from git-commit should include the first line of the commit message as supplied by the user. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Shawn Pearce committed May 24, 2006 at 23:33 UTC 9c7466fa248608ff8a91f8b4dca48dac7dda02d5
1 file changed +26 -12
t/t1400-update-ref.sh
+26 -12
@@ -178,22 +178,36 @@ rm -f .git/$m .git/logs/$m expect
178
179 test_expect_success \
180 'creating initial files' \
181 - 'cp ../../COPYING COPYING &&
182 - git-add COPYING &&
181 + 'echo TEST >F &&
182 + git-add F &&
183 + GIT_AUTHOR_DATE="2005-05-26 23:30" \
184 GIT_COMMITTER_DATE="2005-05-26 23:30" git-commit -m add -a &&
184 - cp ../../Makefile COPYING &&
185 - GIT_COMMITTER_DATE="2005-05-26 23:41" git-commit -m change -a'
185 + h_TEST=$(git-rev-parse --verify HEAD)
186 + echo The other day this did not work. >M &&
187 + echo And then Bob told me how to fix it. >>M &&
188 + echo OTHER >F &&
189 + GIT_AUTHOR_DATE="2005-05-26 23:41" \
190 + GIT_COMMITTER_DATE="2005-05-26 23:41" git-commit -F M -a &&
191 + h_OTHER=$(git-rev-parse --verify HEAD)
192 + rm -f M'
193 +
194 +cat >expect <<EOF
195 +$Z $h_TEST $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 commit: add
196 +$h_TEST $h_OTHER $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150860 +0000 commit: The other day this did not work.
197 +EOF
198 +test_expect_success \
199 + 'git-commit logged updates' \
200 + 'diff expect .git/logs/$m'
201 +unset h_TEST h_OTHER
202
203 test_expect_success \
188 - 'git-cat-file blob master:COPYING (expect Makefile)' \
189 - 'git-cat-file blob master:COPYING | diff - ../../Makefile'
204 + 'git-cat-file blob master:F (expect OTHER)' \
205 + 'test OTHER = $(git-cat-file blob master:F)'
206 test_expect_success \
191 - 'git-cat-file blob master@{2005-05-26 23:30}:COPYING (expect COPYING)' \
192 - 'git-cat-file blob "master@{2005-05-26 23:30}:COPYING" \
193 - | diff - ../../COPYING'
207 + 'git-cat-file blob master@{2005-05-26 23:30}:F (expect TEST)' \
208 + 'test TEST = $(git-cat-file blob "master@{2005-05-26 23:30}:F")'
209 test_expect_success \
195 - 'git-cat-file blob master@{2005-05-26 23:42}:COPYING (expect Makefile)' \
196 - 'git-cat-file blob "master@{2005-05-26 23:42}:COPYING" \
197 - | diff - ../../Makefile'
210 + 'git-cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)' \
211 + 'test OTHER = $(git-cat-file blob "master@{2005-05-26 23:42}:F")'
212
213 test_done