pico
created pr with
12.1
pr_reviewed
cmds
checkout latest patchset:
ssh pr.pico.sh print 12 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 12.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 12
Patchset
12.2
chore: update `pr reopen` cmd as well
Eric Bower
2024-07-22T18:26:44ZSemantic diff summary
0 added,
2 modified,
0 signature changed,
0 removed
across 1 analyzed file
+7
-2
cli.go
#
| ... | ... | @@ -669,13 +669,13 @@ Here's how it works: | |
| 669 | 669 | return err | |
| 670 | 670 | } | |
| 671 | 671 | ||
| 672 | - | user, err := pr.GetUserByID(patchReq.UserID) | |
| 672 | + | patchUser, err := pr.GetUserByID(patchReq.UserID) | |
| 673 | 673 | if err != nil { | |
| 674 | 674 | return err | |
| 675 | 675 | } | |
| 676 | 676 | ||
| 677 | 677 | pk := sesh.PublicKey() | |
| 678 | - | isContrib := pubkey == user.Pubkey | |
| 678 | + | isContrib := pubkey == patchUser.Pubkey | |
| 679 | 679 | isAdmin := be.IsAdmin(pk) | |
| 680 | 680 | if !isAdmin && !isContrib { | |
| 681 | 681 | return fmt.Errorf("you are not authorized to change PR status") |
| ... | ... | @@ -685,6 +685,11 @@ Here's how it works: | |
| 685 | 685 | return fmt.Errorf("PR is already open") | |
| 686 | 686 | } | |
| 687 | 687 | ||
| 688 | + | user, err := pr.UpsertUser(pubkey, userName) | |
| 689 | + | if err != nil { | |
| 690 | + | return err | |
| 691 | + | } | |
| 692 | + | ||
| 688 | 693 | err = pr.UpdatePatchRequestStatus(prID, user.ID, "open") | |
| 689 | 694 | if err == nil { | |
| 690 | 695 | wish.Printf(sesh, "Reopened PR %s (#%d)\n", patchReq.Name, patchReq.ID) |