mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-18 16:01:05 +00:00
074de9d3b3
the `git clone` command. refs #55
22 lines
402 B
Go
22 lines
402 B
Go
package git
|
|
|
|
const (
|
|
DefaultGitDepth = 50
|
|
)
|
|
|
|
// Git stores the configuration details for
|
|
// executing Git commands.
|
|
type Git struct {
|
|
Depth *int `yaml:"depth,omitempty"`
|
|
}
|
|
|
|
// GitDepth returns GitDefaultDepth
|
|
// when Git.Depth is empty.
|
|
// GitDepth returns Git.Depth
|
|
// when it is not empty.
|
|
func GitDepth(g *Git) int {
|
|
if g == nil || g.Depth == nil {
|
|
return DefaultGitDepth
|
|
}
|
|
return *g.Depth
|
|
}
|