diff options
| author | Paul Jolly <paul@myitcv.io> | 2021-07-15 10:29:06 +0100 |
|---|---|---|
| committer | Paul Jolly <paul@myitcv.org.uk> | 2021-07-29 10:11:46 +0000 |
| commit | 2e4fd9a232c3368afeca71043fd7538ed11c681c (patch) | |
| tree | df8555462f594cdf1855e9930d23858dab800d83 /git-codereview/change_test.go | |
| parent | 59af8024e2991b2377085f37062acf68ece50ced (diff) | |
| download | go-x-review-2e4fd9a232c3368afeca71043fd7538ed11c681c.tar.xz | |
git-codereview: add -s option for change
Some projects (CUE, https://cuelang.org, is one such example) use the
Developer Certificate of Origin (https://developercertificate.org) as an
alternative to a CLA. For such projects, all commit messages must
contain the Signed-off-by trailer, with an email address that matches
the commit author. This requires the -s flag to be passed to git commit.
This change adds a -s flag to git-codereview's change command, which is
then simply passed through to git commit.
Change-Id: I6aeac37a1bcdc6e260ae822d3a03117fb87f846f
Reviewed-on: https://go-review.googlesource.com/c/review/+/334750
Trust: Paul Jolly <paul@myitcv.org.uk>
Run-TryBot: Paul Jolly <paul@myitcv.org.uk>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'git-codereview/change_test.go')
| -rw-r--r-- | git-codereview/change_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/git-codereview/change_test.go b/git-codereview/change_test.go index 3e3ea30..cd0cbcc 100644 --- a/git-codereview/change_test.go +++ b/git-codereview/change_test.go @@ -185,3 +185,14 @@ func TestChangeWithMessage(t *testing.T) { testMain(t, "change", "-m", "foo: some commit message") testRan(t, "git commit -q --allow-empty -m foo: some commit message") } + +func TestChangeWithSignoff(t *testing.T) { + gt := newGitTest(t) + defer gt.done() + + testMain(t, "change", "new_branch") + // There are no staged changes, hence an empty commit will be created. + // Hence we also need a commit message. + testMain(t, "change", "-s", "-m", "foo: bar") + testRan(t, "git commit -q --allow-empty -m foo: bar -s") +} |
