mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
Rewrite remoteload_test integration tests (#4783)
* Better error message when git clone fails * support file:// URLs * rewrite remoteload_test * lint and test fix * fixes for kverey's comments * document file:// remote load * replace assert with require where appropriate * add tests for file:// without git suffix * fixes plus pr review from natasha * fixes for review, lint * revert changes to error handling * fix skipped test
This commit is contained in:
@@ -22,15 +22,11 @@ func ClonerUsingGitExec(repoSpec *RepoSpec) error {
|
||||
if err = r.run("init"); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = r.run(
|
||||
"remote", "add", "origin", repoSpec.CloneSpec()); err != nil {
|
||||
return err
|
||||
}
|
||||
ref := "HEAD"
|
||||
if repoSpec.Ref != "" {
|
||||
ref = repoSpec.Ref
|
||||
}
|
||||
if err = r.run("fetch", "--depth=1", "origin", ref); err != nil {
|
||||
if err = r.run("fetch", "--depth=1", repoSpec.CloneSpec(), ref); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = r.run("checkout", "FETCH_HEAD"); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user