Skip to content

Commit 69d75c1

Browse files
committed
Migrate to go-git/go-git v5.0.0 (go-gitea#10735)
1 parent 54ea58d commit 69d75c1

File tree

333 files changed

+15556
-92703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+15556
-92703
lines changed

contrib/pr/checkout.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ import (
2828
"code.gitea.io/gitea/routers"
2929
"code.gitea.io/gitea/routers/routes"
3030

31+
"github.com/go-git/go-git/v5"
32+
"github.com/go-git/go-git/v5/config"
33+
"github.com/go-git/go-git/v5/plumbing"
3134
context2 "github.com/gorilla/context"
3235
"github.com/unknwon/com"
33-
"gopkg.in/src-d/go-git.v4"
34-
"gopkg.in/src-d/go-git.v4/config"
35-
"gopkg.in/src-d/go-git.v4/plumbing"
3636
"gopkg.in/testfixtures.v2"
3737
"xorm.io/xorm"
3838
)

go.mod

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ require (
4141
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect
4242
github.com/gliderlabs/ssh v0.2.2
4343
github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a // indirect
44+
github.com/go-git/go-billy/v5 v5.0.0
45+
github.com/go-git/go-git/v5 v5.0.0
4446
github.com/go-openapi/jsonreference v0.19.3 // indirect
4547
github.com/go-redis/redis v6.15.2+incompatible
4648
github.com/go-sql-driver/mysql v1.4.1
@@ -80,7 +82,7 @@ require (
8082
github.com/quasoft/websspi v1.0.0
8183
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 // indirect
8284
github.com/satori/go.uuid v1.2.0
83-
github.com/sergi/go-diff v1.0.0
85+
github.com/sergi/go-diff v1.1.0
8486
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b // indirect
8587
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
8688
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect
@@ -95,19 +97,17 @@ require (
9597
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53
9698
github.com/yuin/goldmark v1.1.19
9799
go.etcd.io/bbolt v1.3.3 // indirect
98-
golang.org/x/crypto v0.0.0-20200219234226-1ad67e1f0ef4
99-
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9
100+
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
101+
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
100102
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
101-
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c
103+
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
102104
golang.org/x/text v0.3.2
103105
golang.org/x/tools v0.0.0-20191213221258-04c2e8eff935 // indirect
104106
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
105107
gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 // indirect
106108
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
107109
gopkg.in/ini.v1 v1.51.1
108110
gopkg.in/ldap.v3 v3.0.2
109-
gopkg.in/src-d/go-billy.v4 v4.3.2
110-
gopkg.in/src-d/go-git.v4 v4.13.1
111111
gopkg.in/testfixtures.v2 v2.5.0
112112
mvdan.cc/xurls/v2 v2.1.0
113113
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251

go.sum

+25-29
Large diffs are not rendered by default.

modules/git/blob.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"io"
1212
"io/ioutil"
1313

14-
"gopkg.in/src-d/go-git.v4/plumbing"
14+
"github.com/go-git/go-git/v5/plumbing"
1515
)
1616

1717
// Blob represents a Git object.

modules/git/commit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"strconv"
2121
"strings"
2222

23-
"gopkg.in/src-d/go-git.v4/plumbing/object"
23+
"github.com/go-git/go-git/v5/plumbing/object"
2424
)
2525

2626
// Commit represents a git commit.

modules/git/commit_info.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ package git
66

77
import (
88
"github.com/emirpasic/gods/trees/binaryheap"
9-
"gopkg.in/src-d/go-git.v4/plumbing"
10-
"gopkg.in/src-d/go-git.v4/plumbing/object"
11-
cgobject "gopkg.in/src-d/go-git.v4/plumbing/object/commitgraph"
9+
"github.com/go-git/go-git/v5/plumbing"
10+
"github.com/go-git/go-git/v5/plumbing/object"
11+
cgobject "github.com/go-git/go-git/v5/plumbing/object/commitgraph"
1212
)
1313

1414
// GetCommitsInfo gets information of all commits that are corresponding to these entries

modules/git/notes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package git
77
import (
88
"io/ioutil"
99

10-
"gopkg.in/src-d/go-git.v4/plumbing/object"
10+
"github.com/go-git/go-git/v5/plumbing/object"
1111
)
1212

1313
// NotesRef is the git ref where Gitea will look for git-notes data.

modules/git/parse.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"fmt"
1010
"strconv"
1111

12-
"gopkg.in/src-d/go-git.v4/plumbing/filemode"
13-
"gopkg.in/src-d/go-git.v4/plumbing/object"
12+
"github.com/go-git/go-git/v5/plumbing/filemode"
13+
"github.com/go-git/go-git/v5/plumbing/object"
1414
)
1515

1616
// ParseTreeEntries parses the output of a `git ls-tree` command.

modules/git/parse_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ package git
77
import (
88
"testing"
99

10+
"github.com/go-git/go-git/v5/plumbing/filemode"
11+
"github.com/go-git/go-git/v5/plumbing/object"
1012
"github.com/stretchr/testify/assert"
11-
"gopkg.in/src-d/go-git.v4/plumbing/filemode"
12-
"gopkg.in/src-d/go-git.v4/plumbing/object"
1313
)
1414

1515
func TestParseTreeEntries(t *testing.T) {

modules/git/repo.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import (
1818
"time"
1919

2020
gitealog "code.gitea.io/gitea/modules/log"
21+
"github.com/go-git/go-billy/v5/osfs"
22+
gogit "github.com/go-git/go-git/v5"
23+
"github.com/go-git/go-git/v5/plumbing/cache"
24+
"github.com/go-git/go-git/v5/storage/filesystem"
2125
"github.com/unknwon/com"
22-
"gopkg.in/src-d/go-billy.v4/osfs"
23-
gogit "gopkg.in/src-d/go-git.v4"
24-
"gopkg.in/src-d/go-git.v4/plumbing/cache"
25-
"gopkg.in/src-d/go-git.v4/storage/filesystem"
2626
)
2727

2828
// Repository represents a Git repository.

modules/git/repo_blob.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package git
66

77
import (
8-
"gopkg.in/src-d/go-git.v4/plumbing"
8+
"github.com/go-git/go-git/v5/plumbing"
99
)
1010

1111
func (repo *Repository) getBlob(id SHA1) (*Blob, error) {

modules/git/repo_branch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"fmt"
1010
"strings"
1111

12-
"gopkg.in/src-d/go-git.v4/plumbing"
12+
"github.com/go-git/go-git/v5/plumbing"
1313
)
1414

1515
// BranchPrefix base dir of the branch information file store on git

modules/git/repo_commit.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
"strconv"
1313
"strings"
1414

15+
"github.com/go-git/go-git/v5/plumbing"
16+
"github.com/go-git/go-git/v5/plumbing/object"
1517
"github.com/mcuadros/go-version"
16-
"gopkg.in/src-d/go-git.v4/plumbing"
17-
"gopkg.in/src-d/go-git.v4/plumbing/object"
1818
)
1919

2020
// GetRefCommitID returns the last commit ID string of given reference (branch or tag).

modules/git/repo_commitgraph.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111

1212
gitealog "code.gitea.io/gitea/modules/log"
1313

14-
"gopkg.in/src-d/go-git.v4/plumbing/format/commitgraph"
15-
cgobject "gopkg.in/src-d/go-git.v4/plumbing/object/commitgraph"
14+
"github.com/go-git/go-git/v5/plumbing/format/commitgraph"
15+
cgobject "github.com/go-git/go-git/v5/plumbing/object/commitgraph"
1616
)
1717

1818
// CommitNodeIndex returns the index for walking commit graph

modules/git/repo_ref.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ package git
77
import (
88
"strings"
99

10-
"gopkg.in/src-d/go-git.v4"
11-
"gopkg.in/src-d/go-git.v4/plumbing"
10+
"github.com/go-git/go-git/v5"
11+
"github.com/go-git/go-git/v5/plumbing"
1212
)
1313

1414
// GetRefs returns all references of the repository.

modules/git/repo_tag.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"fmt"
1010
"strings"
1111

12+
"github.com/go-git/go-git/v5/plumbing"
1213
"github.com/mcuadros/go-version"
13-
"gopkg.in/src-d/go-git.v4/plumbing"
1414
)
1515

1616
// TagPrefix tags prefix path on the repository

modules/git/sha1.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"fmt"
1111
"strings"
1212

13-
"gopkg.in/src-d/go-git.v4/plumbing"
13+
"github.com/go-git/go-git/v5/plumbing"
1414
)
1515

1616
// EmptySHA defines empty git SHA

modules/git/signature.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"strconv"
1111
"time"
1212

13-
"gopkg.in/src-d/go-git.v4/plumbing/object"
13+
"github.com/go-git/go-git/v5/plumbing/object"
1414
)
1515

1616
// Signature represents the Author or Committer information.

modules/git/tree.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"io"
1010
"strings"
1111

12-
"gopkg.in/src-d/go-git.v4/plumbing"
13-
"gopkg.in/src-d/go-git.v4/plumbing/object"
12+
"github.com/go-git/go-git/v5/plumbing"
13+
"github.com/go-git/go-git/v5/plumbing/object"
1414
)
1515

1616
// Tree represents a flat directory listing.

modules/git/tree_blob.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"path"
1010
"strings"
1111

12-
"gopkg.in/src-d/go-git.v4/plumbing/filemode"
13-
"gopkg.in/src-d/go-git.v4/plumbing/object"
12+
"github.com/go-git/go-git/v5/plumbing/filemode"
13+
"github.com/go-git/go-git/v5/plumbing/object"
1414
)
1515

1616
// GetTreeEntryByPath get the tree entries according the sub dir

modules/git/tree_entry.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"sort"
1111
"strings"
1212

13-
"gopkg.in/src-d/go-git.v4/plumbing"
14-
"gopkg.in/src-d/go-git.v4/plumbing/filemode"
15-
"gopkg.in/src-d/go-git.v4/plumbing/object"
13+
"github.com/go-git/go-git/v5/plumbing"
14+
"github.com/go-git/go-git/v5/plumbing/filemode"
15+
"github.com/go-git/go-git/v5/plumbing/object"
1616
)
1717

1818
// EntryMode the type of the object in the git tree

modules/git/tree_entry_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ package git
77
import (
88
"testing"
99

10+
"github.com/go-git/go-git/v5/plumbing/filemode"
11+
"github.com/go-git/go-git/v5/plumbing/object"
1012
"github.com/stretchr/testify/assert"
11-
"gopkg.in/src-d/go-git.v4/plumbing/filemode"
12-
"gopkg.in/src-d/go-git.v4/plumbing/object"
1313
)
1414

1515
func getTestEntries() Entries {

routers/repo/branch.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import (
1616
"code.gitea.io/gitea/modules/log"
1717
"code.gitea.io/gitea/modules/repofiles"
1818
"code.gitea.io/gitea/modules/util"
19-
"gopkg.in/src-d/go-git.v4/plumbing"
19+
20+
"github.com/go-git/go-git/v5/plumbing"
2021
)
2122

2223
const (

routers/repo/lfs.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ import (
3030
"code.gitea.io/gitea/modules/log"
3131
"code.gitea.io/gitea/modules/setting"
3232

33+
gogit "github.com/go-git/go-git/v5"
34+
"github.com/go-git/go-git/v5/plumbing"
35+
"github.com/go-git/go-git/v5/plumbing/object"
3336
"github.com/mcuadros/go-version"
3437
"github.com/unknwon/com"
35-
gogit "gopkg.in/src-d/go-git.v4"
36-
"gopkg.in/src-d/go-git.v4/plumbing"
37-
"gopkg.in/src-d/go-git.v4/plumbing/object"
3838
)
3939

4040
const (

vendor/github.com/src-d/gcfg/doc.go renamed to vendor/github.com/go-git/gcfg/doc.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/src-d/gcfg/read.go renamed to vendor/github.com/go-git/gcfg/read.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/src-d/gcfg/scanner/errors.go renamed to vendor/github.com/go-git/gcfg/scanner/errors.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/src-d/gcfg/scanner/scanner.go renamed to vendor/github.com/go-git/gcfg/scanner/scanner.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/src-d/gcfg/set.go renamed to vendor/github.com/go-git/gcfg/set.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/go-billy.v4/README.md renamed to vendor/github.com/go-git/go-billy/v5/README.md

+5-4

vendor/github.com/go-git/go-billy/v5/go.mod

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/go-git/go-billy/v5/go.sum

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/go-billy.v4/helper/chroot/chroot.go renamed to vendor/github.com/go-git/go-billy/v5/helper/chroot/chroot.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)