aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modfetch/codehost/git.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-10-24 15:17:16 -0400
committerBryan C. Mills <bcmills@google.com>2019-10-24 20:19:06 +0000
commit680ed10c9127a28ed9510c40d59b1ff10e688bff (patch)
treea68c1b4866a54b495d14c221f97110610d2fb869 /src/cmd/go/internal/modfetch/codehost/git.go
parentc357b363cf1027afe3296e973ea6f6613cc757ad (diff)
downloadgo-680ed10c9127a28ed9510c40d59b1ff10e688bff.tar.gz
go-680ed10c9127a28ed9510c40d59b1ff10e688bff.zip
cmd/go/internal/modfetch/codehost: remove invariantly-empty return value from Repo.ReadZip
Previously, codehost.Repo.ReadZip returned an 'actualSubdir' value that was the empty string in all current implementations. Updates #26092 Change-Id: I6708dd0f13ba88bcf1a1fb405e9d818fd6f9197e Reviewed-on: https://go-review.googlesource.com/c/go/+/203277 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modfetch/codehost/git.go')
-rw-r--r--src/cmd/go/internal/modfetch/codehost/git.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/go/internal/modfetch/codehost/git.go b/src/cmd/go/internal/modfetch/codehost/git.go
index 64d4573c71..4a08f8ded6 100644
--- a/src/cmd/go/internal/modfetch/codehost/git.go
+++ b/src/cmd/go/internal/modfetch/codehost/git.go
@@ -795,7 +795,7 @@ func (r *gitRepo) DescendsFrom(rev, tag string) (bool, error) {
return false, err
}
-func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, actualSubdir string, err error) {
+func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, err error) {
// TODO: Use maxSize or drop it.
args := []string{}
if subdir != "" {
@@ -803,17 +803,17 @@ func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser,
}
info, err := r.Stat(rev) // download rev into local git repo
if err != nil {
- return nil, "", err
+ return nil, err
}
unlock, err := r.mu.Lock()
if err != nil {
- return nil, "", err
+ return nil, err
}
defer unlock()
if err := ensureGitAttributes(r.dir); err != nil {
- return nil, "", err
+ return nil, err
}
// Incredibly, git produces different archives depending on whether
@@ -824,12 +824,12 @@ func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser,
archive, err := Run(r.dir, "git", "-c", "core.autocrlf=input", "-c", "core.eol=lf", "archive", "--format=zip", "--prefix=prefix/", info.Name, args)
if err != nil {
if bytes.Contains(err.(*RunError).Stderr, []byte("did not match any files")) {
- return nil, "", os.ErrNotExist
+ return nil, os.ErrNotExist
}
- return nil, "", err
+ return nil, err
}
- return ioutil.NopCloser(bytes.NewReader(archive)), "", nil
+ return ioutil.NopCloser(bytes.NewReader(archive)), nil
}
// ensureGitAttributes makes sure export-subst and export-ignore features are