aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/hook_test.go
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2016-08-01 08:42:20 +0200
committerJosh Bleecher Snyder <josharian@gmail.com>2016-08-01 16:56:21 +0000
commit748a6d4e5a0ffe1e2a92e4ae5dcd6ee67a4b1b43 (patch)
treed4a80f034d79cdf3a4df4e46a83f1bb18f5bfe9b /git-codereview/hook_test.go
parentc272006fd6c67460073f6630cb366d1e62f66721 (diff)
downloadgo-x-review-748a6d4e5a0ffe1e2a92e4ae5dcd6ee67a4b1b43.tar.xz
git-codereview: fix commitmsg hook when verbose
If the commit message is verbose it shows the diff being committed. This can be shown by either `git commit --verbose` or setting the following in your git config: [commit] verbose = true The diff is uncomented and shown after a "everything below will be removed" comment section. Identify it and do remove everything under it, as otherwise the diff would get mixed up with the commit message. Fixes golang/go#16376. Change-Id: Ia69aeaf36a1c8471da423a142fb233168d455a5d Reviewed-on: https://go-review.googlesource.com/25342 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'git-codereview/hook_test.go')
-rw-r--r--git-codereview/hook_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-codereview/hook_test.go b/git-codereview/hook_test.go
index ca1fff3..0d171c0 100644
--- a/git-codereview/hook_test.go
+++ b/git-codereview/hook_test.go
@@ -66,6 +66,11 @@ func TestHookCommitMsg(t *testing.T) {
{in: "all: gofmt\nahhh", want: "all: gofmt\n\nahhh"},
{in: "all: gofmt\n\nahhh", want: "all: gofmt\n\nahhh"},
{in: "all: gofmt\n\n\nahhh", want: "all: gofmt\n\n\nahhh"},
+ // Issue 16376
+ {
+ in: "all: gofmt\n# ------------------------ >8 ------------------------\ndiff",
+ want: "all: gofmt\n",
+ },
}
for _, tt := range rewrites {
write(t, gt.client+"/in.txt", tt.in)