@@ -16,15 +16,30 @@ var git_cloneCmd = &cobra.Command{
1616func init () {
1717 carapace .Gen (git_cloneCmd ).Standalone ()
1818
19- git_cloneCmd .Flags ().Bool ("colocate" , false , "Whether or not to colocate the Jujutsu repo with the git repo" )
19+ git_cloneCmd .Flags ().StringSlice ("bookmark" , nil , "Name of the branch to fetch and use as the parent of the working-copy change" )
20+ git_cloneCmd .Flags ().StringSliceP ("branch" , "b" , nil , "Name of the branch to fetch and use as the parent of the working-copy change" )
21+ git_cloneCmd .Flags ().Bool ("colocate" , false , "Colocate the Jujutsu repo with the git repo" )
2022 git_cloneCmd .Flags ().String ("depth" , "" , "Create a shallow clone of the given depth" )
2123 git_cloneCmd .Flags ().String ("fetch-tags" , "" , "Configure when to fetch tags" )
2224 git_cloneCmd .Flags ().BoolP ("help" , "h" , false , "Print help (see more with '--help')" )
2325 git_cloneCmd .Flags ().Bool ("no-colocate" , false , "Disable colocation of the Jujutsu repo with the git repo" )
2426 git_cloneCmd .Flags ().String ("remote" , "" , "Name of the newly created remote" )
27+ git_cloneCmd .Flag ("bookmark" ).Hidden = true
2528 gitCmd .AddCommand (git_cloneCmd )
2629
2730 carapace .Gen (git_cloneCmd ).FlagCompletion (carapace.ActionMap {
31+ "bookmark" : carapace .ActionCallback (func (c carapace.Context ) carapace.Action {
32+ if len (c .Args ) == 0 {
33+ return carapace .ActionValues ()
34+ }
35+ return git .ActionLsRemoteRefs (git.LsRemoteRefOption {Url : c .Args [0 ], Branches : true })
36+ }),
37+ "branch" : carapace .ActionCallback (func (c carapace.Context ) carapace.Action {
38+ if len (c .Args ) == 0 {
39+ return carapace .ActionValues ()
40+ }
41+ return git .ActionLsRemoteRefs (git.LsRemoteRefOption {Url : c .Args [0 ], Branches : true })
42+ }),
2843 "fetch-tags" : carapace .ActionValues ("all" , "included" , "none" ).StyleF (style .ForKeyword ),
2944 })
3045
0 commit comments