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

This commit is contained in:
Lauris BH 2020-03-17 18:19:58 +02:00 committed by GitHub
parent 2f928316db
commit 43c09134a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
315 changed files with 15239 additions and 92420 deletions

View file

@ -11,7 +11,7 @@ import (
"code.gitea.io/gitea/modules/log"
mc "gitea.com/macaron/cache"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"github.com/go-git/go-git/v5/plumbing/object"
)
// LastCommitCache represents a cache to store last commit

View file

@ -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.

View file

@ -4,7 +4,7 @@
package git
import "gopkg.in/src-d/go-git.v4/plumbing/object"
import "github.com/go-git/go-git/v5/plumbing/object"
// LastCommitCache cache
type LastCommitCache interface {

View file

@ -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.

View file

@ -8,9 +8,9 @@ import (
"path"
"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

View file

@ -10,7 +10,7 @@ import (
"io"
"strings"
"gopkg.in/src-d/go-git.v4/plumbing"
"github.com/go-git/go-git/v5/plumbing"
)
// CommitFromReader will generate a Commit from a provided reader

View file

@ -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.

View file

@ -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.

View file

@ -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) {

View file

@ -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.

View file

@ -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) {

View file

@ -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

View file

@ -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).

View file

@ -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

View file

@ -12,10 +12,10 @@ import (
"code.gitea.io/gitea/modules/analyze"
"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/src-d/enry/v2"
"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 fileSizeLimit int64 = 16 * 1024 * 1024

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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 {