Skip to content

Commit

Permalink
commands/clone,git: support '--shallow-since'
Browse files Browse the repository at this point in the history
  • Loading branch information
ttaylorr committed May 22, 2017
1 parent 0d51ac8 commit 42b4d53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions commands/command_clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func init() {
cmd.Flags().BoolVarP(&cloneFlags.Verbose, "verbose", "", false, "See 'git clone --help'")
cmd.Flags().BoolVarP(&cloneFlags.Ipv4, "ipv4", "", false, "See 'git clone --help'")
cmd.Flags().BoolVarP(&cloneFlags.Ipv6, "ipv6", "", false, "See 'git clone --help'")
cmd.Flags().StringVarP(&cloneFlags.ShallowSince, "shallow-since", "", "", "See 'git clone --help'")

cmd.Flags().StringVarP(&includeArg, "include", "I", "", "Include a list of paths")
cmd.Flags().StringVarP(&excludeArg, "exclude", "X", "", "Exclude a list of paths")
Expand Down
5 changes: 5 additions & 0 deletions git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,8 @@ type CloneFlags struct {
Ipv4 bool
// --ipv6
Ipv6 bool
// --shallow-since <date>
ShallowSince string
}

// CloneWithoutFilters clones a git repo but without the smudge filter enabled
Expand Down Expand Up @@ -902,6 +904,9 @@ func CloneWithoutFilters(flags CloneFlags, args []string) error {
if flags.Verbose {
cmdargs = append(cmdargs, "--verbose")
}
if len(flags.ShallowSince) > 0 {
cmdargs = append(cmdargs, "--shallow-since", flags.ShallowSince)
}

// Now args
cmdargs = append(cmdargs, args...)
Expand Down

0 comments on commit 42b4d53

Please sign in to comment.