Skip to content

Commit

Permalink
fix(merge): Do not truncate commits with special characters
Browse files Browse the repository at this point in the history
Signed-off-by: Cezar Craciunoiu <[email protected]>
  • Loading branch information
craciunoiuc committed Jan 10, 2024
1 parent dd6bc39 commit a70fdd0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/governctl/pr/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ func (opts *Merge) Run(ctx context.Context, args []string) error {

patch.Trailers = append(patch.Trailers, opts.Trailers...)

// Bug in git: it starts reading from triple dashes and discard everything
// till it finds "diff", meaning, for example, dependabot PRs will have
// truncated messages. This is fine for now.
patch.Message = strings.ReplaceAll(patch.Message, "---", "...")

cmd := exec.Command("git", "-C", opts.Repo, "am", "--3way")
cmd.Stdin = bytes.NewReader(patch.Bytes())
cmd.Stderr = log.G(ctx).WriterLevel(logrus.ErrorLevel)
Expand Down

0 comments on commit a70fdd0

Please sign in to comment.