Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
ft: Add mr update flag to assinge to change current assigne (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
zemzale committed Oct 14, 2020
1 parent cab05b6 commit c6577e7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions commands/mr/update/mr_update.go
Expand Up @@ -77,6 +77,13 @@ func NewCmdUpdate(f *cmdutils.Factory) *cobra.Command {
if m, _ := cmd.Flags().GetString("description"); m != "" {
l.Description = gitlab.String(m)
}
if assignee, _ := cmd.Flags().GetString("assignee"); assignee != "" {
user, err := api.UserByName(apiClient, assignee)
if err != nil {
return err
}
l.AssigneeID = gitlab.Int(user.ID)
}
mr, err := api.UpdateMR(apiClient, repo.FullName(), mergeID, l)
if err != nil {
return err
Expand All @@ -93,6 +100,7 @@ func NewCmdUpdate(f *cmdutils.Factory) *cobra.Command {
mrUpdateCmd.Flags().StringP("title", "t", "", "Title of merge request")
mrUpdateCmd.Flags().BoolP("lock-discussion", "", false, "Lock discussion on merge request")
mrUpdateCmd.Flags().StringP("description", "d", "", "merge request description")
mrUpdateCmd.Flags().StringP("assignee", "a", "", "merge request assignee")

return mrUpdateCmd
}

0 comments on commit c6577e7

Please sign in to comment.