Migrate to go-git/go-git v5.0.0 (#10735)
parent
2f928316db
commit
43c09134a9
0
vendor/github.com/src-d/gcfg/errors.go → vendor/github.com/go-git/gcfg/errors.go
generated
vendored
0
vendor/github.com/src-d/gcfg/errors.go → vendor/github.com/go-git/gcfg/errors.go
generated
vendored
@ -1,20 +1,21 @@ |
|||||||
# go-billy [![GoDoc](https://godoc.org/gopkg.in/src-d/go-billy.v4?status.svg)](https://godoc.org/gopkg.in/src-d/go-billy.v4) [![Build Status](https://travis-ci.com/src-d/go-billy.svg)](https://travis-ci.com/src-d/go-billy) [![Build status](https://ci.appveyor.com/api/projects/status/vx2qn6vlakbi724t?svg=true)](https://ci.appveyor.com/project/mcuadros/go-billy) [![codecov](https://codecov.io/gh/src-d/go-billy/branch/master/graph/badge.svg)](https://codecov.io/gh/src-d/go-billy) |
# go-billy [![GoDoc](https://godoc.org/gopkg.in/go-git/go-billy.v5?status.svg)](https://pkg.go.dev/github.com/go-git/go-billy) [![Test](https://github.com/go-git/go-billy/workflows/Test/badge.svg)](https://github.com/go-git/go-billy/actions?query=workflow%3ATest) |
||||||
|
|
||||||
The missing interface filesystem abstraction for Go. |
The missing interface filesystem abstraction for Go. |
||||||
Billy implements an interface based on the `os` standard library, allowing to develop applications without dependency on the underlying storage. Makes it virtually free to implement mocks and testing over filesystem operations. |
Billy implements an interface based on the `os` standard library, allowing to develop applications without dependency on the underlying storage. Makes it virtually free to implement mocks and testing over filesystem operations. |
||||||
|
|
||||||
Billy was born as part of [src-d/go-git](https://github.com/src-d/go-git) project. |
Billy was born as part of [go-git/go-git](https://github.com/go-git/go-git) project. |
||||||
|
|
||||||
## Installation |
## Installation |
||||||
|
|
||||||
```go |
```go |
||||||
go get -u gopkg.in/src-d/go-billy.v4/... |
import "github.com/go-git/go-billy/v5" // with go modules enabled (GO111MODULE=on or outside GOPATH) |
||||||
|
import "github.com/go-git/go-billy" // with go modules disabled |
||||||
``` |
``` |
||||||
|
|
||||||
## Usage |
## Usage |
||||||
|
|
||||||
Billy exposes filesystems using the |
Billy exposes filesystems using the |
||||||
[`Filesystem` interface](https://godoc.org/github.com/src-d/go-billy#Filesystem). |
[`Filesystem` interface](https://pkg.go.dev/github.com/go-git/go-billy/v5?tab=doc#Filesystem). |
||||||
Each filesystem implementation gives you a `New` method, whose arguments depend on |
Each filesystem implementation gives you a `New` method, whose arguments depend on |
||||||
the implementation itself, that returns a new `Filesystem`. |
the implementation itself, that returns a new `Filesystem`. |
||||||
|
|
0
vendor/gopkg.in/src-d/go-billy.v4/fs.go → vendor/github.com/go-git/go-billy/v5/fs.go
generated
vendored
0
vendor/gopkg.in/src-d/go-billy.v4/fs.go → vendor/github.com/go-git/go-billy/v5/fs.go
generated
vendored
@ -0,0 +1,10 @@ |
|||||||
|
module github.com/go-git/go-billy/v5 |
||||||
|
|
||||||
|
require ( |
||||||
|
github.com/kr/text v0.2.0 // indirect |
||||||
|
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect |
||||||
|
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 |
||||||
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f |
||||||
|
) |
||||||
|
|
||||||
|
go 1.13 |
@ -0,0 +1,14 @@ |
|||||||
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= |
||||||
|
github.com/go-git/go-billy v1.0.0 h1:bXR6Zu3opPSg0R4dDxqaLglY4rxw7ja7wS16qSpOKL4= |
||||||
|
github.com/go-git/go-billy v3.1.0+incompatible h1:dwrJ8G2Jt1srYgIJs+lRjA36qBY68O2Lg5idKG8ef5M= |
||||||
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= |
||||||
|
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= |
||||||
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= |
||||||
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= |
||||||
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= |
||||||
|
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= |
||||||
|
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= |
||||||
|
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= |
||||||
|
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
||||||
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= |
||||||
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= |
@ -0,0 +1,83 @@ |
|||||||
|
package osfs |
||||||
|
|
||||||
|
import ( |
||||||
|
"io" |
||||||
|
"os" |
||||||
|
"path/filepath" |
||||||
|
"syscall" |
||||||
|
) |
||||||
|
|
||||||
|
func (f *file) Lock() error { |
||||||
|
// Plan 9 uses a mode bit instead of explicit lock/unlock syscalls.
|
||||||
|
//
|
||||||
|
// Per http://man.cat-v.org/plan_9/5/stat: “Exclusive use files may be open
|
||||||
|
// for I/O by only one fid at a time across all clients of the server. If a
|
||||||
|
// second open is attempted, it draws an error.”
|
||||||
|
//
|
||||||
|
// There is no obvious way to implement this function using the exclusive use bit.
|
||||||
|
// See https://golang.org/src/cmd/go/internal/lockedfile/lockedfile_plan9.go
|
||||||
|
// for how file locking is done by the go tool on Plan 9.
|
||||||
|
return nil |
||||||
|
} |
||||||
|
|
||||||
|
func (f *file) Unlock() error { |
||||||
|
return nil |
||||||
|
} |
||||||
|
|
||||||
|
func rename(from, to string) error { |
||||||
|
// If from and to are in different directories, copy the file
|
||||||
|
// since Plan 9 does not support cross-directory rename.
|
||||||
|
if filepath.Dir(from) != filepath.Dir(to) { |
||||||
|
fi, err := os.Stat(from) |
||||||
|
if err != nil { |
||||||
|
return &os.LinkError{"rename", from, to, err} |
||||||
|
} |
||||||
|
if fi.Mode().IsDir() { |
||||||
|
return &os.LinkError{"rename", from, to, syscall.EISDIR} |
||||||
|
} |
||||||
|
fromFile, err := os.Open(from) |
||||||
|
if err != nil { |
||||||
|
return &os.LinkError{"rename", from, to, err} |
||||||
|
} |
||||||
|
toFile, err := os.OpenFile(to, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode()) |
||||||
|
if err != nil { |
||||||
|
return &os.LinkError{"rename", from, to, err} |
||||||
|
} |
||||||
|
_, err = io.Copy(toFile, fromFile) |
||||||
|
if err != nil { |
||||||
|
return &os.LinkError{"rename", from, to, err} |
||||||
|
} |
||||||
|
|
||||||
|
// Copy mtime and mode from original file.
|
||||||
|
// We need only one syscall if we avoid os.Chmod and os.Chtimes.
|
||||||
|
dir := fi.Sys().(*syscall.Dir) |
||||||
|
var d syscall.Dir |
||||||
|
d.Null() |
||||||
|
d.Mtime = dir.Mtime |
||||||
|
d.Mode = dir.Mode |
||||||
|
if err = dirwstat(to, &d); err != nil { |
||||||
|
return &os.LinkError{"rename", from, to, err} |
||||||
|
} |
||||||
|
|
||||||
|
// Remove original file.
|
||||||
|
err = os.Remove(from) |
||||||
|
if err != nil { |
||||||
|
return &os.LinkError{"rename", from, to, err} |
||||||
|
} |
||||||
|
return nil |
||||||
|
} |
||||||
|
return os.Rename(from, to) |
||||||
|
} |
||||||
|
|
||||||
|
func dirwstat(name string, d *syscall.Dir) error { |
||||||
|
var buf [syscall.STATFIXLEN]byte |
||||||
|
|
||||||
|
n, err := d.Marshal(buf[:]) |
||||||
|
if err != nil { |
||||||
|
return &os.PathError{"dirwstat", name, err} |
||||||
|
} |
||||||
|
if err = syscall.Wstat(name, buf[:n]); err != nil { |
||||||
|
return &os.PathError{"dirwstat", name, err} |
||||||
|
} |
||||||
|
return nil |
||||||
|
} |
0
vendor/gopkg.in/src-d/go-git.v4/LICENSE → vendor/github.com/go-git/go-git/v5/LICENSE
generated
vendored
0
vendor/gopkg.in/src-d/go-git.v4/LICENSE → vendor/github.com/go-git/go-git/v5/LICENSE
generated
vendored
@ -0,0 +1,38 @@ |
|||||||
|
# General
|
||||||
|
WORKDIR = $(PWD)
|
||||||
|
|
||||||
|
# Go parameters
|
||||||
|
GOCMD = go
|
||||||
|
GOTEST = $(GOCMD) test
|
||||||
|
|
||||||
|
# Git config
|
||||||
|
GIT_VERSION ?=
|
||||||
|
GIT_DIST_PATH ?= $(PWD)/.git-dist
|
||||||
|
GIT_REPOSITORY = http://github.com/git/git.git
|
||||||
|
|
||||||
|
# Coverage
|
||||||
|
COVERAGE_REPORT = coverage.out
|
||||||
|
COVERAGE_MODE = count
|
||||||
|
|
||||||
|
build-git: |
||||||
|
@if [ -f $(GIT_DIST_PATH)/git ]; then \
|
||||||
|
echo "nothing to do, using cache $(GIT_DIST_PATH)"; \
|
||||||
|
else \
|
||||||
|
git clone $(GIT_REPOSITORY) -b $(GIT_VERSION) --depth 1 --single-branch $(GIT_DIST_PATH); \
|
||||||
|
cd $(GIT_DIST_PATH); \
|
||||||
|
make configure; \
|
||||||
|
./configure; \
|
||||||
|
make all; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
test: |
||||||
|
@echo "running against `git version`"; \
|
||||||
|
$(GOTEST) ./...
|
||||||
|
|
||||||
|
test-coverage: |
||||||
|
@echo "running against `git version`"; \
|
||||||
|
echo "" > $(COVERAGE_REPORT); \
|
||||||
|
$(GOTEST) -coverprofile=$(COVERAGE_REPORT) -coverpkg=./... -covermode=$(COVERAGE_MODE) ./...
|
||||||
|
|
||||||
|
clean: |
||||||
|
rm -rf $(GIT_DIST_PATH)
|
30
vendor/gopkg.in/src-d/go-git.v4/README.md → vendor/github.com/go-git/go-git/v5/README.md
generated
vendored
30
vendor/gopkg.in/src-d/go-git.v4/README.md → vendor/github.com/go-git/go-git/v5/README.md
generated
vendored
2
vendor/gopkg.in/src-d/go-git.v4/doc.go → vendor/github.com/go-git/go-git/v5/doc.go
generated
vendored
2
vendor/gopkg.in/src-d/go-git.v4/doc.go → vendor/github.com/go-git/go-git/v5/doc.go
generated
vendored
22
vendor/gopkg.in/src-d/go-git.v4/go.mod → vendor/github.com/go-git/go-git/v5/go.mod
generated
vendored
22
vendor/gopkg.in/src-d/go-git.v4/go.mod → vendor/github.com/go-git/go-git/v5/go.mod
generated
vendored
@ -1,29 +1,27 @@ |
|||||||
module gopkg.in/src-d/go-git.v4 |
module github.com/go-git/go-git/v5 |
||||||
|
|
||||||
require ( |
require ( |
||||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect |
|
||||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect |
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect |
||||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 |
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 |
||||||
github.com/emirpasic/gods v1.12.0 |
github.com/emirpasic/gods v1.12.0 |
||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect |
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect |
||||||
github.com/gliderlabs/ssh v0.2.2 |
github.com/gliderlabs/ssh v0.2.2 |
||||||
|
github.com/go-git/gcfg v1.5.0 |
||||||
|
github.com/go-git/go-billy/v5 v5.0.0 |
||||||
|
github.com/go-git/go-git-fixtures/v4 v4.0.1 |
||||||
github.com/google/go-cmp v0.3.0 |
github.com/google/go-cmp v0.3.0 |
||||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 |
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 |
||||||
github.com/jessevdk/go-flags v1.4.0 |
github.com/jessevdk/go-flags v1.4.0 |
||||||
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd |
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd |
||||||
github.com/mitchellh/go-homedir v1.1.0 |
github.com/mitchellh/go-homedir v1.1.0 |
||||||
github.com/pelletier/go-buffruneio v0.2.0 // indirect |
|
||||||
github.com/pkg/errors v0.8.1 // indirect |
github.com/pkg/errors v0.8.1 // indirect |
||||||
github.com/sergi/go-diff v1.0.0 |
github.com/sergi/go-diff v1.1.0 |
||||||
github.com/src-d/gcfg v1.4.0 |
|
||||||
github.com/stretchr/objx v0.2.0 // indirect |
|
||||||
github.com/xanzy/ssh-agent v0.2.1 |
github.com/xanzy/ssh-agent v0.2.1 |
||||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 |
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 |
||||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 |
golang.org/x/net v0.0.0-20200301022130-244492dfa37a |
||||||
golang.org/x/text v0.3.2 |
golang.org/x/text v0.3.2 |
||||||
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a // indirect |
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f |
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 |
|
||||||
gopkg.in/src-d/go-billy.v4 v4.3.2 |
|
||||||
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 |
|
||||||
gopkg.in/warnings.v0 v0.1.2 // indirect |
gopkg.in/warnings.v0 v0.1.2 // indirect |
||||||
) |
) |
||||||
|
|
||||||
|
go 1.13 |
74
vendor/gopkg.in/src-d/go-git.v4/go.sum → vendor/github.com/go-git/go-git/v5/go.sum
generated
vendored
74
vendor/gopkg.in/src-d/go-git.v4/go.sum → vendor/github.com/go-git/go-git/v5/go.sum
generated
vendored
@ -1,5 +1,5 @@ |
|||||||
// Package revision extracts git revision from string
|
// Package revision extracts git revision from string
|
||||||
// More informations about revision : https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html
|
// More information about revision : https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html
|
||||||
package revision |
package revision |
||||||
|
|
||||||
import ( |
import ( |
@ -1,6 +1,6 @@ |
|||||||
package cache |
package cache |
||||||
|
|
||||||
import "gopkg.in/src-d/go-git.v4/plumbing" |
import "github.com/go-git/go-git/v5/plumbing" |
||||||
|
|
||||||
const ( |
const ( |
||||||
Byte FileSize = 1 << (iota * 10) |
Byte FileSize = 1 << (iota * 10) |
@ -1,7 +1,7 @@ |
|||||||
package commitgraph |
package commitgraph |
||||||
|
|
||||||
import ( |
import ( |
||||||
"gopkg.in/src-d/go-git.v4/plumbing" |
"github.com/go-git/go-git/v5/plumbing" |
||||||
) |
) |
||||||
|
|
||||||
// MemoryIndex provides a way to build the commit-graph in memory
|
// MemoryIndex provides a way to build the commit-graph in memory
|
@ -1,8 +1,8 @@ |
|||||||
package diff |
package diff |
||||||
|
|
||||||
import ( |
import ( |
||||||
"gopkg.in/src-d/go-git.v4/plumbing" |
"github.com/go-git/go-git/v5/plumbing" |
||||||
"gopkg.in/src-d/go-git.v4/plumbing/filemode" |
"github.com/go-git/go-git/v5/plumbing/filemode" |
||||||
) |
) |
||||||
|
|
||||||
// Operation defines the operation of a diff item.
|
// Operation defines the operation of a diff item.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue