diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:26:57 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:26:57 +0800 |
commit | 20b4fe0c59357a433042732d46e38da9c3d14c3b (patch) | |
tree | 537d7d450701a839802b1d57a82bd07324dcba90 /git_misc.go | |
parent | misc: Move utils.go's string function to misc (diff) | |
download | forge-20b4fe0c59357a433042732d46e38da9c3d14c3b.tar.gz forge-20b4fe0c59357a433042732d46e38da9c3d14c3b.tar.zst forge-20b4fe0c59357a433042732d46e38da9c3d14c3b.zip |
database shall no longer be a global variable
Diffstat (limited to '')
-rw-r--r-- | git_misc.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/git_misc.go b/git_misc.go index 8e72d0c..8dda01c 100644 --- a/git_misc.go +++ b/git_misc.go @@ -22,8 +22,8 @@ import ( // TODO: This should be deprecated in favor of doing it in the relevant // request/router context in the future, as it cannot cover the nuance of // fields needed. -func openRepo(ctx context.Context, groupPath []string, repoName string) (repo *git.Repository, description string, repoID int, fsPath string, err error) { - err = database.QueryRow(ctx, ` +func (s *server) openRepo(ctx context.Context, groupPath []string, repoName string) (repo *git.Repository, description string, repoID int, fsPath string, err error) { + err = s.database.QueryRow(ctx, ` WITH RECURSIVE group_path_cte AS ( -- Start: match the first name in the path where parent_group IS NULL SELECT |