if opts.Author != nil {
cmd.AddOptionFormat("--author='%s <%s>'", opts.Author.Name, opts.Author.Email)
}
- cmd.AddOptionValues("-m", opts.Message)
+ cmd.AddOptionFormat("--message=%s", opts.Message)
_, _, err := cmd.RunStdString(&RunOpts{Dir: repoPath})
// No stderr but exit status 1 means nothing to commit.
return fmt.Errorf("git add --all: %w", err)
}
- cmd := git.NewCommand(ctx, "commit").
- AddOptionFormat("--author='%s <%s>'", sig.Name, sig.Email).
- AddOptionValues("-m", "Initial commit")
+ cmd := git.NewCommand(ctx, "commit", "--message=Initial commit").
+ AddOptionFormat("--author='%s <%s>'", sig.Name, sig.Email)
sign, keyID, signer, _ := asymkey_service.SignInitialCommit(ctx, tmpPath, u)
if sign {
if err := git.NewCommand(ctx, "commit").
AddArguments(signArgs...).
AddOptionFormat("--author='%s <%s>'", sig.Name, sig.Email).
- AddOptionValues("-m", message).
+ AddOptionFormat("--message=%s", message).
Run(&git.RunOpts{
Env: env,
Dir: tmpBasePath,
func commitAndSignNoAuthor(ctx context.Context, pr *issues_model.PullRequest, message string, signArgs git.TrustedCmdArgs, tmpBasePath string, env []string) error {
var outbuf, errbuf strings.Builder
- if err := git.NewCommand(ctx, "commit").AddArguments(signArgs...).AddOptionValues("-m", message).
+ if err := git.NewCommand(ctx, "commit").AddArguments(signArgs...).AddOptionFormat("--message=%s", message).
Run(&git.RunOpts{
Env: env,
Dir: tmpBasePath,