Skip to content

Commit 6bfebe6

Browse files
committed
Perform a shallow clone in the git provider for faster startup
Running katafygio for a couple of months on rather active cluster results in a huge git repo. On startup, katafygio clone the git repository, which in our case was very slow, exceeding the configured deadlines. This PR propose to perform a shallow clone with a depth of 1: katafygio doesn't need to full history to work, and the startup is much snappier.
1 parent 7b0af9e commit 6bfebe6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/store/git/git.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func (s *Store) CloneOrInit() (err error) {
161161
if s.URL == "" {
162162
err = s.Git("init", s.LocalDir)
163163
} else {
164-
err = s.Git("clone", s.URL, s.LocalDir)
164+
err = s.Git("clone", "--depth=1", s.URL, s.LocalDir)
165165
}
166166

167167
if err != nil {

0 commit comments

Comments
 (0)