Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to go-git/go-git v5.0.0 (#10735) #10753

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions contrib/pr/checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import (
"code.gitea.io/gitea/routers"
"code.gitea.io/gitea/routers/routes"

"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/config"
"github.com/go-git/go-git/v5/plumbing"
context2 "github.com/gorilla/context"
"github.com/unknwon/com"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/testfixtures.v2"
"xorm.io/xorm"
)
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ require (
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect
github.com/gliderlabs/ssh v0.2.2
github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a // indirect
github.com/go-git/go-billy/v5 v5.0.0
github.com/go-git/go-git/v5 v5.0.0
github.com/go-openapi/jsonreference v0.19.3 // indirect
github.com/go-redis/redis v6.15.2+incompatible
github.com/go-sql-driver/mysql v1.4.1
Expand Down Expand Up @@ -80,7 +82,7 @@ require (
github.com/quasoft/websspi v1.0.0
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 // indirect
github.com/satori/go.uuid v1.2.0
github.com/sergi/go-diff v1.0.0
github.com/sergi/go-diff v1.1.0
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b // indirect
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect
Expand All @@ -95,19 +97,17 @@ require (
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53
github.com/yuin/goldmark v1.1.19
go.etcd.io/bbolt v1.3.3 // indirect
golang.org/x/crypto v0.0.0-20200219234226-1ad67e1f0ef4
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
golang.org/x/text v0.3.2
golang.org/x/tools v0.0.0-20191213221258-04c2e8eff935 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 // indirect
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/ini.v1 v1.51.1
gopkg.in/ldap.v3 v3.0.2
gopkg.in/src-d/go-billy.v4 v4.3.2
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/testfixtures.v2 v2.5.0
mvdan.cc/xurls/v2 v2.1.0
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
Expand Down
54 changes: 25 additions & 29 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/git/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"io"
"io/ioutil"

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

// Blob represents a Git object.
Expand Down
2 changes: 1 addition & 1 deletion modules/git/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"strconv"
"strings"

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

// Commit represents a git commit.
Expand Down
6 changes: 3 additions & 3 deletions modules/git/commit_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ package git

import (
"github.com/emirpasic/gods/trees/binaryheap"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/object"
cgobject "gopkg.in/src-d/go-git.v4/plumbing/object/commitgraph"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
cgobject "github.com/go-git/go-git/v5/plumbing/object/commitgraph"
)

// GetCommitsInfo gets information of all commits that are corresponding to these entries
Expand Down
2 changes: 1 addition & 1 deletion modules/git/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package git
import (
"io/ioutil"

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

// NotesRef is the git ref where Gitea will look for git-notes data.
Expand Down
4 changes: 2 additions & 2 deletions modules/git/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"fmt"
"strconv"

"gopkg.in/src-d/go-git.v4/plumbing/filemode"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"github.com/go-git/go-git/v5/plumbing/filemode"
"github.com/go-git/go-git/v5/plumbing/object"
)

// ParseTreeEntries parses the output of a `git ls-tree` command.
Expand Down
4 changes: 2 additions & 2 deletions modules/git/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package git
import (
"testing"

"github.com/go-git/go-git/v5/plumbing/filemode"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/stretchr/testify/assert"
"gopkg.in/src-d/go-git.v4/plumbing/filemode"
"gopkg.in/src-d/go-git.v4/plumbing/object"
)

func TestParseTreeEntries(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions modules/git/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"time"

gitealog "code.gitea.io/gitea/modules/log"
"github.com/go-git/go-billy/v5/osfs"
gogit "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/cache"
"github.com/go-git/go-git/v5/storage/filesystem"
"github.com/unknwon/com"
"gopkg.in/src-d/go-billy.v4/osfs"
gogit "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
"gopkg.in/src-d/go-git.v4/storage/filesystem"
)

// Repository represents a Git repository.
Expand Down
2 changes: 1 addition & 1 deletion modules/git/repo_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package git

import (
"gopkg.in/src-d/go-git.v4/plumbing"
"github.com/go-git/go-git/v5/plumbing"
)

func (repo *Repository) getBlob(id SHA1) (*Blob, error) {
Expand Down
2 changes: 1 addition & 1 deletion modules/git/repo_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"fmt"
"strings"

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

// BranchPrefix base dir of the branch information file store on git
Expand Down
4 changes: 2 additions & 2 deletions modules/git/repo_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"strconv"
"strings"

"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/mcuadros/go-version"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/object"
)

// GetRefCommitID returns the last commit ID string of given reference (branch or tag).
Expand Down
4 changes: 2 additions & 2 deletions modules/git/repo_commitgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

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

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

// CommitNodeIndex returns the index for walking commit graph
Expand Down
4 changes: 2 additions & 2 deletions modules/git/repo_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package git
import (
"strings"

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

// GetRefs returns all references of the repository.
Expand Down
2 changes: 1 addition & 1 deletion modules/git/repo_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"fmt"
"strings"

"github.com/go-git/go-git/v5/plumbing"
"github.com/mcuadros/go-version"
"gopkg.in/src-d/go-git.v4/plumbing"
)

// TagPrefix tags prefix path on the repository
Expand Down
2 changes: 1 addition & 1 deletion modules/git/sha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
"strings"

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

// EmptySHA defines empty git SHA
Expand Down
2 changes: 1 addition & 1 deletion modules/git/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
"time"

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

// Signature represents the Author or Committer information.
Expand Down
4 changes: 2 additions & 2 deletions modules/git/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"io"
"strings"

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

// Tree represents a flat directory listing.
Expand Down
4 changes: 2 additions & 2 deletions modules/git/tree_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"path"
"strings"

"gopkg.in/src-d/go-git.v4/plumbing/filemode"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"github.com/go-git/go-git/v5/plumbing/filemode"
"github.com/go-git/go-git/v5/plumbing/object"
)

// GetTreeEntryByPath get the tree entries according the sub dir
Expand Down
6 changes: 3 additions & 3 deletions modules/git/tree_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"sort"
"strings"

"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/filemode"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/filemode"
"github.com/go-git/go-git/v5/plumbing/object"
)

// EntryMode the type of the object in the git tree
Expand Down
4 changes: 2 additions & 2 deletions modules/git/tree_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package git
import (
"testing"

"github.com/go-git/go-git/v5/plumbing/filemode"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/stretchr/testify/assert"
"gopkg.in/src-d/go-git.v4/plumbing/filemode"
"gopkg.in/src-d/go-git.v4/plumbing/object"
)

func getTestEntries() Entries {
Expand Down
3 changes: 2 additions & 1 deletion routers/repo/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/repofiles"
"code.gitea.io/gitea/modules/util"
"gopkg.in/src-d/go-git.v4/plumbing"

"github.com/go-git/go-git/v5/plumbing"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions routers/repo/lfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"

gogit "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/mcuadros/go-version"
"github.com/unknwon/com"
gogit "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/object"
)

const (
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions vendor/github.com/go-git/go-billy/v5/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions vendor/github.com/go-git/go-billy/v5/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading