|
554 | 554 | # amend-gomod-at checks out the go.mod at the given commit and amend it to the previous commit.
|
555 | 555 | function amend-gomod-at() {
|
556 | 556 | if [ -f go.mod ]; then
|
557 |
| - git checkout ${f_mainline_commit} go.mod # reset to mainline state which is guaranteed to be correct |
| 557 | + git checkout ${f_mainline_commit} go.mod go.sum # reset to mainline state which is guaranteed to be correct |
558 | 558 | git commit --amend --no-edit -q
|
559 | 559 | fi
|
560 | 560 | }
|
@@ -630,9 +630,9 @@ function show-working-dir-status() {
|
630 | 630 |
|
631 | 631 | function gomod-changes() {
|
632 | 632 | if [ -n "${2:-}" ]; then
|
633 |
| - ! git diff --exit-code --quiet ${1} ${2} -- go.mod |
| 633 | + ! git diff --exit-code --quiet ${1} ${2} -- go.mod go.sum |
634 | 634 | else
|
635 |
| - ! git diff --exit-code --quiet $(state-before-commit ${1}) ${1} -- go.mod |
| 635 | + ! git diff --exit-code --quiet $(state-before-commit ${1}) ${1} -- go.mod go.sum |
636 | 636 | fi
|
637 | 637 | }
|
638 | 638 |
|
@@ -735,7 +735,7 @@ function fix-gomod() {
|
735 | 735 | echo "Resolving dependencies for Godeps.json generation"
|
736 | 736 | GOPROXY="file://${GOPATH}/pkg/mod/cache/download" GO111MODULE=on go list -m -json all > /tmp/go-list
|
737 | 737 | /godeps-gen /tmp/go-list Godeps/Godeps.json
|
738 |
| - git add Godeps go.mod # go.mod is surprisingly written: EOF newline |
| 738 | + git add Godeps go.mod go.sum # go.mod is surprisingly written: EOF newline |
739 | 739 | if ! git-index-clean; then
|
740 | 740 | git commit -q -m "sync: update Godeps/Godeps.json"
|
741 | 741 | fi
|
@@ -786,11 +786,11 @@ function reset-gomod() {
|
786 | 786 |
|
787 | 787 | # checkout or delete go.mod
|
788 | 788 | if [ -n "$(git ls-tree ${f_clean_commit}^{tree} go.mod)" ]; then
|
789 |
| - git checkout ${f_clean_commit} go.mod |
790 |
| - git add go.mod |
| 789 | + git checkout ${f_clean_commit} go.mod go.sum |
| 790 | + git add go.mod go.sum |
791 | 791 | elif [ -f go.mod ]; then
|
792 |
| - rm -f go.mod |
793 |
| - git rm -f go.mod |
| 792 | + rm -f go.mod go.sum |
| 793 | + git rm -f go.mod go.sum |
794 | 794 | fi
|
795 | 795 |
|
796 | 796 | # commit go.mod unconditionally
|
|
0 commit comments