Skip to content

Commit 175e46c

Browse files
committed
Merge pull request 'fixed the issue with private repo cloning' (#154) from fixing-private-repo-cloning into main
Reviewed-on: https://gitea.obmondo.com/EnableIT/kubeaid-bootstrap-script/pulls/154
2 parents 6c29d66 + 2496c9b commit 175e46c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/utils/git/clone.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,10 @@ func IsRepoPrivate(ctx context.Context, repoURL string) (bool, error) {
136136

137137
// If the request was unsuccessful, then the repo isn't public.
138138
if response.StatusCode != http.StatusOK {
139-
return false, nil
139+
// If status is NOT 200 OK, it means it's likely private.
140+
return true, nil
140141
}
141142

142-
// Request was successful, which means the repo is public.
143-
return true, nil
143+
// Request was successful (status was 200 OK), which means the repo is public.
144+
return false, nil
144145
}

0 commit comments

Comments
 (0)