mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 10:54:01 +01:00
Do not include global arguments in process manager (#19226)
The git command by default adds a number of global arguments. These are not helpful to be displayed in the process manager and so should be skipped for default process descriptions. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
793ce9dacf
commit
41b60d94db
1 changed files with 10 additions and 8 deletions
|
@ -36,6 +36,7 @@ type Command struct {
|
|||
args []string
|
||||
parentContext context.Context
|
||||
desc string
|
||||
globalArgsLength int
|
||||
}
|
||||
|
||||
func (c *Command) String() string {
|
||||
|
@ -54,6 +55,7 @@ func NewCommand(ctx context.Context, args ...string) *Command {
|
|||
name: GitExecutable,
|
||||
args: append(cargs, args...),
|
||||
parentContext: ctx,
|
||||
globalArgsLength: len(globalCommandArgs),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,7 +142,7 @@ func (c *Command) RunWithContext(rc *RunContext) error {
|
|||
|
||||
desc := c.desc
|
||||
if desc == "" {
|
||||
desc = fmt.Sprintf("%s %s [repo_path: %s]", c.name, strings.Join(c.args, " "), rc.Dir)
|
||||
desc = fmt.Sprintf("%s %s [repo_path: %s]", c.name, strings.Join(c.args[c.globalArgsLength:], " "), rc.Dir)
|
||||
}
|
||||
|
||||
ctx, cancel, finished := process.GetManager().AddContextTimeout(c.parentContext, rc.Timeout, desc)
|
||||
|
|
Loading…
Reference in a new issue