mirror of
https://github.com/harness/drone.git
synced 2025-05-12 23:20:10 +08:00
23 lines
402 B
Go
23 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
|
|
}
|