Skip to content

Commit

Permalink
Update internal/exec/go_getter_utils.go
Browse files Browse the repository at this point in the history
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
  • Loading branch information
Listener430 and osterman authored Feb 6, 2025
1 parent 7382cab commit a9c8f48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/exec/go_getter_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ func (d *CustomGitHubDetector) Detect(src, _ string) (string, bool, error) {
}
}

// Ensure that the "depth" parameter is set to "1" if the key does not exist.
// Set "depth=1" for a shallow clone if not specified.
// In Go-Getter, "depth" controls how many revisions are cloned:
// - `depth=1` fetches only the latest commit (faster, less bandwidth).
// - `depth=` (empty) performs a full clone (default Git behavior).
// - `depth=N` clones the last N revisions.
q := parsedURL.Query()
if _, exists := q["depth"]; !exists {
q.Set("depth", "1")
Expand Down

0 comments on commit a9c8f48

Please sign in to comment.