Skip to content

Commit

Permalink
Merge 57e4b2e into 929386f
Browse files Browse the repository at this point in the history
  • Loading branch information
bpineau committed Jul 21, 2019
2 parents 929386f + 57e4b2e commit 3db2c92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pkg/store/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ func (s *Store) CloneOrInit() (err error) {
}
}

// One may both sync with a remote repos and keep a persistent local clone
if _, err := os.Stat(fmt.Sprintf("%s/.git/index", s.LocalDir)); err == nil {
return nil
}

if s.URL == "" {
err = s.Git("init", s.LocalDir)
} else {
Expand Down
4 changes: 2 additions & 2 deletions pkg/store/git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ func TestGit(t *testing.T) {
// test various failure modes

_, err = repo.Start()
if err == nil {
t.Error("Start/Clone on an existing repository should fail")
if err != nil {
t.Error("Start/Clone on an existing repository should not fail")
}

err = repo.Git("fortzob", "42")
Expand Down

0 comments on commit 3db2c92

Please sign in to comment.