Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into jon/cligroups
  • Loading branch information
sreya committed Oct 25, 2022
commit 8e3bdc2fdece23e78211eb762aa618d35be0dde3
13 changes: 13 additions & 0 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ func Root(subcommands []*cobra.Command) *cobra.Command {
SilenceErrors: true,
SilenceUsage: true,
Long: fmt.Sprintf(fmtLong, buildinfo.Version()),
Args: func(cmd *cobra.Command, args []string) error {
if gitauth.CheckCommand(args, os.Environ()) {
isGitAskpass = true
return nil
}
return cobra.NoArgs(cmd, args)
},
RunE: func(cmd *cobra.Command, args []string) error {
if isGitAskpass {
return gitAskpass().RunE(cmd, args)
}
return cmd.Help()
},
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if cliflag.IsSetBool(cmd, varNoVersionCheck) &&
cliflag.IsSetBool(cmd, varNoFeatureWarning) {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.