aboutsummaryrefslogtreecommitdiff
path: root/ssh_handle_receive_pack.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-20 11:32:52 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-20 11:32:52 +0800
commitf947e4d7e72c45e9a4199ed191a4396db2ac3c60 (patch)
tree3496900b0c11e67f5f38d0cc58b58e58173e3e32 /ssh_handle_receive_pack.go
parenthooks: Clarify the last ACK/NAK being overall (diff)
downloadforge-f947e4d7e72c45e9a4199ed191a4396db2ac3c60.tar.gz
forge-f947e4d7e72c45e9a4199ed191a4396db2ac3c60.tar.zst
forge-f947e4d7e72c45e9a4199ed191a4396db2ac3c60.zip
hooks, ssh: Indicate URL of newly-created MRs
Diffstat (limited to 'ssh_handle_receive_pack.go')
-rw-r--r--ssh_handle_receive_pack.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/ssh_handle_receive_pack.go b/ssh_handle_receive_pack.go
index 8803151..af576bc 100644
--- a/ssh_handle_receive_pack.go
+++ b/ssh_handle_receive_pack.go
@@ -17,13 +17,15 @@ type pack_to_hook_t struct {
repo_path string
user_id int
repo_id int
+ group_name string
+ repo_name string
}
var pack_to_hook_by_cookie = cmap.Map[string, pack_to_hook_t]{}
// ssh_handle_receive_pack handles attempts to push to repos.
func ssh_handle_receive_pack(session glider_ssh.Session, pubkey string, repo_identifier string) (err error) {
- repo_id, repo_path, direct_access, contrib_requirements, user_type, user_id, err := get_repo_path_perms_from_ssh_path_pubkey(session.Context(), repo_identifier, pubkey)
+ group_name, repo_name, repo_id, repo_path, direct_access, contrib_requirements, user_type, user_id, err := get_repo_path_perms_from_ssh_path_pubkey(session.Context(), repo_identifier, pubkey)
if err != nil {
return err
}
@@ -60,6 +62,8 @@ func ssh_handle_receive_pack(session glider_ssh.Session, pubkey string, repo_ide
fmt.Fprintln(session.Stderr(), "Error while generating cookie:", err)
}
+ fmt.Println(group_name, repo_name)
+
pack_to_hook_by_cookie.Store(cookie, pack_to_hook_t{
session: session,
pubkey: pubkey,
@@ -67,6 +71,8 @@ func ssh_handle_receive_pack(session glider_ssh.Session, pubkey string, repo_ide
repo_path: repo_path,
user_id: user_id,
repo_id: repo_id,
+ group_name: group_name,
+ repo_name: repo_name,
})
defer pack_to_hook_by_cookie.Delete(cookie)
// The Delete won't execute until proc.Wait returns unless something