aboutsummaryrefslogtreecommitdiff
path: root/lib/git/git.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/git.go')
-rw-r--r--lib/git/git.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/git/git.go b/lib/git/git.go
index 18576797..3e067c03 100644
--- a/lib/git/git.go
+++ b/lib/git/git.go
@@ -35,6 +35,10 @@ var (
// If branch is empty, it will use default branch "master".
// If revision is empty, it will do nothing.
//
+// This function assume that repository is up-to-date with remote.
+// Client may call FetchAll() before, to prevent checking out revision that
+// may not exist.
+//
func CheckoutRevision(repoDir, ref, branch, revision string) error {
if len(revision) == 0 {
return nil
@@ -54,12 +58,6 @@ func CheckoutRevision(repoDir, ref, branch, revision string) error {
return err
}
- err = FetchAll(repoDir)
- if err != nil {
- err = fmt.Errorf("CheckoutRevision: %s", err)
- return err
- }
-
cmd = exec.Command("git")
cmd.Dir = repoDir
cmd.Stdout = _stdout