trivial comments
This commit is contained in:
parent
287a0e5464
commit
e97eff010f
|
|
@ -575,6 +575,7 @@ func syncRepo(ctx context.Context, repo, branch, rev string, depth int, gitRoot,
|
||||||
_, err := os.Stat(gitRepoPath)
|
_, err := os.Stat(gitRepoPath)
|
||||||
switch {
|
switch {
|
||||||
case os.IsNotExist(err):
|
case os.IsNotExist(err):
|
||||||
|
// First time. Just clone it and get the hash.
|
||||||
err = cloneRepo(ctx, repo, branch, rev, depth, gitRoot)
|
err = cloneRepo(ctx, repo, branch, rev, depth, gitRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, "", err
|
return false, "", err
|
||||||
|
|
@ -586,6 +587,7 @@ func syncRepo(ctx context.Context, repo, branch, rev string, depth int, gitRoot,
|
||||||
case err != nil:
|
case err != nil:
|
||||||
return false, "", fmt.Errorf("error checking if repo exists %q: %v", gitRepoPath, err)
|
return false, "", fmt.Errorf("error checking if repo exists %q: %v", gitRepoPath, err)
|
||||||
default:
|
default:
|
||||||
|
// Not the first time. Figure out if the ref has changed.
|
||||||
local, remote, err := getRevs(ctx, target, branch, rev)
|
local, remote, err := getRevs(ctx, target, branch, rev)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, "", err
|
return false, "", err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue