diff options
Diffstat (limited to 'git_hooks_handle_other.go')
-rw-r--r-- | git_hooks_handle_other.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git_hooks_handle_other.go b/git_hooks_handle_other.go index 6d5b08d..ed75e7a 100644 --- a/git_hooks_handle_other.go +++ b/git_hooks_handle_other.go @@ -211,12 +211,12 @@ func (s *server) hooksHandler(conn net.Conn) { var newMRLocalID int if packPass.userID != 0 { - err = database.QueryRow(ctx, + err = s.database.QueryRow(ctx, "INSERT INTO merge_requests (repo_id, creator, source_ref, status) VALUES ($1, $2, $3, 'open') RETURNING repo_local_id", packPass.repoID, packPass.userID, strings.TrimPrefix(refName, "refs/heads/"), ).Scan(&newMRLocalID) } else { - err = database.QueryRow(ctx, + err = s.database.QueryRow(ctx, "INSERT INTO merge_requests (repo_id, source_ref, status) VALUES ($1, $2, 'open') RETURNING repo_local_id", packPass.repoID, strings.TrimPrefix(refName, "refs/heads/"), ).Scan(&newMRLocalID) @@ -237,7 +237,7 @@ func (s *server) hooksHandler(conn net.Conn) { var existingMRUser int var isAncestor bool - err = database.QueryRow(ctx, + err = s.database.QueryRow(ctx, "SELECT COALESCE(creator, 0) FROM merge_requests WHERE source_ref = $1 AND repo_id = $2", strings.TrimPrefix(refName, "refs/heads/"), packPass.repoID, ).Scan(&existingMRUser) |