|
|
@ -24,19 +24,17 @@ func GetCommitGraph(r *git.Repository, page, maxAllowedColors int, hidePRRefs bo |
|
|
|
page = 1 |
|
|
|
page = 1 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
args := make([]string, 0, 12+len(branches)+len(files)) |
|
|
|
graphCmd := git.NewCommand(r.Ctx, "log", "--graph", "--date-order", "--decorate=full") |
|
|
|
|
|
|
|
|
|
|
|
args = append(args, "--graph", "--date-order", "--decorate=full") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if hidePRRefs { |
|
|
|
if hidePRRefs { |
|
|
|
args = append(args, "--exclude="+git.PullPrefix+"*") |
|
|
|
graphCmd.AddArguments("--exclude=" + git.PullPrefix + "*") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if len(branches) == 0 { |
|
|
|
if len(branches) == 0 { |
|
|
|
args = append(args, "--all") |
|
|
|
graphCmd.AddArguments("--all") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
args = append(args, |
|
|
|
graphCmd.AddArguments( |
|
|
|
"-C", |
|
|
|
"-C", |
|
|
|
"-M", |
|
|
|
"-M", |
|
|
|
fmt.Sprintf("-n %d", setting.UI.GraphMaxCommitNum*page), |
|
|
|
fmt.Sprintf("-n %d", setting.UI.GraphMaxCommitNum*page), |
|
|
@ -44,15 +42,12 @@ func GetCommitGraph(r *git.Repository, page, maxAllowedColors int, hidePRRefs bo |
|
|
|
fmt.Sprintf("--pretty=format:%s", format)) |
|
|
|
fmt.Sprintf("--pretty=format:%s", format)) |
|
|
|
|
|
|
|
|
|
|
|
if len(branches) > 0 { |
|
|
|
if len(branches) > 0 { |
|
|
|
args = append(args, branches...) |
|
|
|
graphCmd.AddDynamicArguments(branches...) |
|
|
|
} |
|
|
|
} |
|
|
|
args = append(args, "--") |
|
|
|
|
|
|
|
if len(files) > 0 { |
|
|
|
if len(files) > 0 { |
|
|
|
args = append(args, files...) |
|
|
|
graphCmd.AddArguments("--") |
|
|
|
|
|
|
|
graphCmd.AddArguments(files...) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
graphCmd := git.NewCommand(r.Ctx, "log") |
|
|
|
|
|
|
|
graphCmd.AddArguments(args...) |
|
|
|
|
|
|
|
graph := NewGraph() |
|
|
|
graph := NewGraph() |
|
|
|
|
|
|
|
|
|
|
|
stderr := new(strings.Builder) |
|
|
|
stderr := new(strings.Builder) |
|
|
|