From 98e363b852407d041e7e703f218f932a43382102 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 24 Apr 2018 18:20:13 +0200 Subject: 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. --- pkg/git/git.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pkg/git/git.go') 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 } -- cgit mrf-deployment