aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/mail_test.go
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2021-12-03 20:11:11 +0100
committerTobias Klauser <tobias.klauser@gmail.com>2021-12-03 21:50:33 +0000
commitb8ead204a2e00eca3f1554da0b908d1d7b7afb9f (patch)
tree9cdf67d000154fb147b0883cb755bd76b4523a01 /git-codereview/mail_test.go
parent4305ba78f05fd75ba1bc3be8457fcc2501da2c5e (diff)
downloadgo-x-review-b8ead204a2e00eca3f1554da0b908d1d7b7afb9f.tar.xz
git-codereview: don't sign git tags
For users who set tag.gpgSign=true in their git configuration, git-codereview mail currently fails to create the .mailed git tag because a signed git tag always requires a message: fatal: no tag message? (running: git tag -f foobar.mailed cf87726ac456) /home/tklauser/go/bin/git-codereview: exit status 128 Fix this by overriding the tag.gpgSign configuration using git tag --no-sign. There is no point in having these tags signed as they should never leave the local system. Change-Id: I8b7ddf3aa7709e6ea06e4d5add6cd581e9ec2e37 Reviewed-on: https://go-review.googlesource.com/c/review/+/369194 Trust: Tobias Klauser <tobias.klauser@gmail.com> Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'git-codereview/mail_test.go')
-rw-r--r--git-codereview/mail_test.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/git-codereview/mail_test.go b/git-codereview/mail_test.go
index 72fea82..a376ea3 100644
--- a/git-codereview/mail_test.go
+++ b/git-codereview/mail_test.go
@@ -29,7 +29,7 @@ func TestMail(t *testing.T) {
testMain(t, "mail")
testRan(t,
"git push -q origin HEAD:refs/for/main",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
}
func TestDoNotMail(t *testing.T) {
@@ -160,14 +160,14 @@ func TestMailMultiple(t *testing.T) {
testMain(t, "mail", "HEAD^")
testRan(t,
"git push -q origin "+h+":refs/for/main",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
// Mail HEAD.
h = CurrentBranch().Pending()[0].ShortHash
testMain(t, "mail", "HEAD")
testRan(t,
"git push -q origin HEAD:refs/for/main",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
}
var reviewerLog = []string{
@@ -212,17 +212,17 @@ func TestMailShort(t *testing.T) {
testMain(t, "mail")
testRan(t,
"git push -q origin HEAD:refs/for/main",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
testMain(t, "mail", "-r", "r1")
testRan(t,
"git push -q origin HEAD:refs/for/main%r=r1@golang.org",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
testMain(t, "mail", "-r", "other,anon", "-cc", "r1,full@email.com")
testRan(t,
"git push -q origin HEAD:refs/for/main%r=other@golang.org,r=anon@golang.org,cc=r1@golang.org,cc=full@email.com",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
testMainDied(t, "mail", "-r", "other", "-r", "anon,r1,missing")
testPrintedStderr(t, "unknown reviewer: missing")
@@ -238,7 +238,7 @@ func TestWIP(t *testing.T) {
testMain(t, "mail", "-wip")
testRan(t,
"git push -q origin HEAD:refs/for/main%wip",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
}
func TestMailTopic(t *testing.T) {
@@ -264,7 +264,7 @@ func TestMailTopic(t *testing.T) {
testMain(t, "mail", "-topic", "test-topic")
testRan(t,
"git push -q origin HEAD:refs/for/main%topic=test-topic",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
}
func TestMailHashtag(t *testing.T) {
@@ -287,11 +287,11 @@ func TestMailHashtag(t *testing.T) {
testMain(t, "mail", "-hashtag", "test1,test2")
testRan(t,
"git push -q origin HEAD:refs/for/main%hashtag=test1,hashtag=test2",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
testMain(t, "mail", "-hashtag", "")
testRan(t,
"git push -q origin HEAD:refs/for/main",
- "git tag -f work.mailed "+h)
+ "git tag --no-sign -f work.mailed "+h)
testMainDied(t, "mail", "-hashtag", "test1,,test3")
testPrintedStderr(t, "hashtag may not contain empty tags")