aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/git/git.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-24 18:20:13 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-04-24 19:17:07 +0200
commit98e363b852407d041e7e703f218f932a43382102 (patch)
tree27d5c0212f14138626ccdd797eda0fdeee66a92a /pkg/git/git.go
parent4707a1792395d168fe31d8ac57f42cdfdc6ba556 (diff)
pkg/git: don't create shallow repos
Shallow repos created by CheckoutBranch conflict with what CheckoutCommit tries to do. Fetch of a shallow repo does not unshallow it. And then checkout of a non-head commit fails.
Diffstat (limited to 'pkg/git/git.go')
-rw-r--r--pkg/git/git.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/git/git.go b/pkg/git/git.go
index 77a2630f2..812f919c8 100644
--- a/pkg/git/git.go
+++ b/pkg/git/git.go
@@ -58,14 +58,13 @@ func Poll(dir, repo, branch string) (*Commit, error) {
}
// CheckoutBranch checkouts the specified repository/branch in dir.
-// It does not fetch history and efficiently supports checkouts of different repos in the same dir.
func CheckoutBranch(dir, repo, branch string) (*Commit, error) {
if _, err := runSandboxed(dir, "git", "reset", "--hard"); err != nil {
if err := initRepo(dir); err != nil {
return nil, err
}
}
- _, err := runSandboxed(dir, "git", "fetch", "--no-tags", "--depth=1", repo, branch)
+ _, err := runSandboxed(dir, "git", "fetch", repo, branch)
if err != nil {
return nil, err
}