aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/gofmt_test.go
AgeCommit message (Collapse)Author
2024-01-25git-codereview: remove usage of io/ioutilv1.9.0Joshua Sing
io/ioutil is now deprecated. Use non-deprecated equivalents. Change-Id: Iad1cc9c14dbdad3a6f9ada25072bc194bace4081 Reviewed-on: https://go-review.googlesource.com/c/review/+/543615 Reviewed-by: qiulaidongfeng <2645477756@qq.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2021-01-07git-codereview: update tests for "main" branch defaultRuss Cox
"git init ." leaves me on "main" now, not "master". Update tests to expect that, and update the "tracking" message too (otherwise the tests fail). Because not all gits agree about the initial branch name, set it explicitly too in the test. Fixes #42926. Change-Id: If3adb3bb53beba9efcd75cad0f081f59fba85fe7 Reviewed-on: https://go-review.googlesource.com/c/review/+/279873 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Austin Clements <austin@google.com>
2019-12-16git-codereview: write hooks with execute permission in testsBryan C. Mills
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>
2019-01-22git-codereview: do not check vendor folder with gofmtDaniel Theophanes
The go command already skips the vendor folder when running go fmt. The "go mod vendor" command updates all vendor packages at once, so this becomes more of an issue. Change-Id: I0b2d51d2f1f01998e9ca7a244af491bd18150e8a Reviewed-on: https://go-review.googlesource.com/c/158839 Run-TryBot: Daniel Theophanes <kardianos@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-03-02git-codereview: call testMain instead of executing "git codereview ..."Alex Brainman
Fixes #9648 Change-Id: I86995c262fee31eb17c1dcb6c9e48fe632b78cf0 Reviewed-on: https://go-review.googlesource.com/6425 Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-21git-codereview: use fromSlash in TestGofmtSubdir* to make them pass on windowsAlex Brainman
Change-Id: Ic59299a544d2a8887b305b202c0f5da758ff7322 Reviewed-on: https://go-review.googlesource.com/3071 Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-19git-codereview: work around git checkout-index bug in gofmtRuss Cox
If you run 'git gofmt' when files in the working directory differ from modified files in the index and you are running the command not from that working directory or a parent, then git checkout-index --temp (used by git gofmt) will print mangled path names, confusing git gofmt. The most common error this causes is: git-codereview: gofmt reported errors: stat : no such file or directory although there are other possible ways it can fail. I've reported the git bug, which will be fixed in Git 2.3.0. Work around the bug by always invoking git checkout-index in the repo root. Fixes #9476. Change-Id: Ifcbdfd4a966dd21518dd95ceacd81a1679048e3c Reviewed-on: https://go-review.googlesource.com/2907 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-19git-codereview: use might not use the aliases of codereviewMarkus Zimmermann
The tests of git-codereview fail if the aliases are not configured for "git codereview change" to "git change". This can be fixed by simply using the full commands for the codereview commands. Change-Id: I6b8df2610d0956a8153ce6190d0677d7f2b12ac9 Reviewed-on: https://go-review.googlesource.com/2976 Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-14git-codereview: do not gofmt committed files during mergeRuss Cox
Change-Id: Ie772b8f46587ad0d56350b697e75601f45b4c393 Reviewed-on: https://go-review.googlesource.com/2785 Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-06git-codereview: make tests pass on windowsAlex Brainman
- "git gofmt" uses "git checkout-index" command that is broken if used with many arguments - limit number of arguments passed to "git checkout-index"; - change / into \ on windows when matching git output on windows; - add .gitattributes to test repository to make it look more like all real Go repositories; - make sure no files left behind in /tmp on windows. Fixes golang/go#9433. Change-Id: Ifceacfffd1cd4b02190d7e941611d0d0f3c48cdd Reviewed-on: https://go-review.googlesource.com/2089 Reviewed-by: Russ Cox <rsc@golang.org>
2014-12-30git-codereview: guard against ambiguous revision parametersAnthony Martin
Change-Id: I3afcf06e1eab28bfdb2c6ace7aaf774070084900 Reviewed-on: https://go-review.googlesource.com/1783 Reviewed-by: Russ Cox <rsc@golang.org>
2014-12-23git-codereview: fix a few corner case failuresRuss Cox
- make it clearer what the random git command at the end of failures means - avoid some problems with detached HEAD mode in hooks run during git rebase - redirect all stdout/stderr into test buffers Change-Id: I102f22fc870f69c884728eaa46ecc95792d5b795 Reviewed-on: https://go-review.googlesource.com/2011 Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2014-12-18git-codereview: rename from 'git-review' to 'git-codereview'Andrew Gerrand
Mostly trivial search and replace, except for hooks.go which includes a special case to remove the old git-review hooks. Change-Id: Ic0792bb3e26607e5e0ead88958e46c3ac08288cd Reviewed-on: https://go-review.googlesource.com/1741 Reviewed-by: Russ Cox <rsc@golang.org>