pico

created pr with 12.1 on 2024-07-22T17:56:38Z · by 964fa508
pr_reviewed on 2024-07-22T18:28:48Z · by c8ef7d19
cmds
checkout latest patchset:
ssh pr.pico.sh print 12 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 12.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 12
+7 -2 cli.go #
......@@ -669,13 +669,13 @@ Here's how it works:
669669 return err
670670 }
671671
672- user, err := pr.GetUserByID(patchReq.UserID)
672+ patchUser, err := pr.GetUserByID(patchReq.UserID)
673673 if err != nil {
674674 return err
675675 }
676676
677677 pk := sesh.PublicKey()
678- isContrib := pubkey == user.Pubkey
678+ isContrib := pubkey == patchUser.Pubkey
679679 isAdmin := be.IsAdmin(pk)
680680 if !isAdmin && !isContrib {
681681 return fmt.Errorf("you are not authorized to change PR status")
......@@ -685,6 +685,11 @@ Here's how it works:
685685 return fmt.Errorf("PR is already open")
686686 }
687687
688+ user, err := pr.UpsertUser(pubkey, userName)
689+ if err != nil {
690+ return err
691+ }
692+
688693 err = pr.UpdatePatchRequestStatus(prID, user.ID, "open")
689694 if err == nil {
690695 wish.Printf(sesh, "Reopened PR %s (#%d)\n", patchReq.Name, patchReq.ID)
Back to top