repos / git-pr

a self-hosted git collaboration server
git clone https://github.com/picosh/git-pr.git

commit
cb5796b
parent
46ea9e7
author
Eric Bower
date
2024-06-04 22:52:34 -0400 EDT
chore: pr status print success msg
1 files changed,  +15, -0
M cli.go
M cli.go
+15, -0
 1@@ -354,7 +354,16 @@ Here's how it works:
 2 							if !isAdmin {
 3 								return fmt.Errorf("you are not authorized to accept a PR")
 4 							}
 5+
 6+							patchReq, err := pr.GetPatchRequestByID(prID)
 7+							if err != nil {
 8+								return err
 9+							}
10+
11 							err = pr.UpdatePatchRequest(prID, pubkey, "accepted")
12+							if err != nil {
13+								wish.Printf(sesh, "Accepted PR %s (#%d)\n", patchReq.Name, patchReq.ID)
14+							}
15 							return err
16 						},
17 					},
18@@ -379,6 +388,9 @@ Here's how it works:
19 								return fmt.Errorf("you are not authorized to change PR status")
20 							}
21 							err = pr.UpdatePatchRequest(prID, pubkey, "closed")
22+							if err != nil {
23+								wish.Printf(sesh, "Closed PR %s (#%d)\n", patchReq.Name, patchReq.ID)
24+							}
25 							return err
26 						},
27 					},
28@@ -404,6 +416,9 @@ Here's how it works:
29 							}
30 
31 							err = pr.UpdatePatchRequest(prID, pubkey, "open")
32+							if err != nil {
33+								wish.Printf(sesh, "Reopened PR %s (#%d)\n", patchReq.Name, patchReq.ID)
34+							}
35 							return err
36 						},
37 					},