Attribute accepted commits to the prompting user's configured Git identity
Hop-State: A_06FN8A13TXD2FW71C2B7MDR Hop-Proposal: R_06FN89ZN929C6HYFDPJ2B48 Hop-Task: T_06FN892CVE210TZR2ZQQ9JG Hop-Attempt: AT_06FN892CVDGHFG3F889Q3YR
This commit is contained in:
+13
-1
@@ -757,7 +757,19 @@ func (s *Service) accept(ctx context.Context, proposalID string, checkCommand []
|
||||
message = "Accept " + proposal.ID
|
||||
}
|
||||
message += fmt.Sprintf("\n\nHop-State: %s\nHop-Proposal: %s\nHop-Task: %s\nHop-Attempt: %s\n", acceptedID, proposal.ID, proposal.TaskID, proposal.AttemptID)
|
||||
commit, err := s.Repo.CommitTree(ctx, finalTree, []string{current.GitCommit}, message)
|
||||
author, configured, err := s.Repo.ConfiguredUserIdentity(ctx)
|
||||
if err != nil {
|
||||
return AcceptResult{}, err
|
||||
}
|
||||
if !configured {
|
||||
author = s.Repo.SyntheticIdentity()
|
||||
}
|
||||
commit, err := s.Repo.CommitTreeWithOptions(ctx, finalTree, CommitOptions{
|
||||
Message: message,
|
||||
Parents: []string{current.GitCommit},
|
||||
Author: author,
|
||||
Committer: s.Repo.SyntheticIdentity(),
|
||||
})
|
||||
if err != nil {
|
||||
return AcceptResult{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user