aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/sync_test.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-12-16 10:05:06 -0500
committerBryan C. Mills <bcmills@google.com>2019-12-16 19:06:16 +0000
commitf64da474f58aa878a967c0f87c39747f42fe6b63 (patch)
tree3651191f3158470b284a11085f74b68d2bf66cd5 /git-codereview/sync_test.go
parentbe34946817dcf706c2f9448ebd50102472c552f6 (diff)
downloadgo-x-review-f64da474f58aa878a967c0f87c39747f42fe6b63.tar.xz
git-codereview: write hooks with execute permission in tests
The 'write' helper function previously assumed file permission 0666. We don't actually need these files to be world-writable, but we do need specific ones — scripts executed as Git commit hooks — to be executable, at least on certain platforms. Also use t.Helper() to produce more useful log lines for failures. (That was added in order to diagnose TryBot failures.) Fixes golang/go#32836 Change-Id: I2d670563f42778ef8cf645445420756599c37ac6 Reviewed-on: https://go-review.googlesource.com/c/review/+/211477 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
Diffstat (limited to 'git-codereview/sync_test.go')
-rw-r--r--git-codereview/sync_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-codereview/sync_test.go b/git-codereview/sync_test.go
index 88461b3..a4210ab 100644
--- a/git-codereview/sync_test.go
+++ b/git-codereview/sync_test.go
@@ -13,9 +13,9 @@ func TestSync(t *testing.T) {
testMain(t, "change", "work")
// check for error with unstaged changes
- write(t, gt.client+"/file1", "")
+ write(t, gt.client+"/file1", "", 0644)
trun(t, gt.client, "git", "add", "file1")
- write(t, gt.client+"/file1", "actual content")
+ write(t, gt.client+"/file1", "actual content", 0644)
testMainDied(t, "sync")
testPrintedStderr(t, "cannot sync: unstaged changes exist",
"git status", "git stash", "git add", "git-codereview change")
@@ -35,7 +35,7 @@ func TestSync(t *testing.T) {
testNoStderr(t)
// make server 1 step ahead of client
- write(t, gt.server+"/file", "new content")
+ write(t, gt.server+"/file", "new content", 0644)
trun(t, gt.server, "git", "add", "file")
trun(t, gt.server, "git", "commit", "-m", "msg")