diff options
| author | jnovick <joshua.novick@hunters.ai> | 2024-08-14 04:22:00 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-13 21:22:00 -0400 |
| commit | 859900ef39bbaa54d18298615fca843e0488b106 (patch) | |
| tree | a6efb8797bf834c5434ddd6009d9752fe401b6b8 /ext/git/git_test.go | |
| parent | 0ad5b94ff483bd2045e7adb3f54b1ca4c700d3da (diff) | |
feat: Use shallow clone to speed up performance (#830)
Signed-off-by: Joshua Novick <joshua.novick@hunters.ai>
Diffstat (limited to 'ext/git/git_test.go')
| -rw-r--r-- | ext/git/git_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/git/git_test.go b/ext/git/git_test.go index 0eebe35..508ecf8 100644 --- a/ext/git/git_test.go +++ b/ext/git/git_test.go @@ -322,6 +322,25 @@ func TestVerifyCommitSignature(t *testing.T) { } } +func TestVerifyShallowFetchCheckout(t *testing.T) { + p := t.TempDir() + + client, err := NewClientExt("https://github.com/argoproj/argo-cd.git", p, NopCreds{}, false, false, "") + assert.NoError(t, err) + + err = client.Init() + assert.NoError(t, err) + + err = client.ShallowFetch("HEAD", 1) + assert.NoError(t, err) + + commitSHA, err := client.LsRemote("HEAD") + assert.NoError(t, err) + + err = client.Checkout(commitSHA, true) + assert.NoError(t, err) +} + func TestNewFactory(t *testing.T) { addBinDirToPath := path.NewBinDirToPath() defer addBinDirToPath.Close() |
