diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-19 01:02:33 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-19 01:02:33 +0800 |
commit | 2d3e888321baeae889c7c51f2312aafba1ec70d0 (patch) | |
tree | 030c79f59ac2f62cce1567fd3fc07607b224d2fd /git_misc.go | |
parent | http: Consistently use redirect_with{out,}_slash, never r.URL.Path (diff) | |
download | forge-2d3e888321baeae889c7c51f2312aafba1ec70d0.tar.gz forge-2d3e888321baeae889c7c51f2312aafba1ec70d0.tar.zst forge-2d3e888321baeae889c7c51f2312aafba1ec70d0.zip |
contrib: Add contrib/MR index page
Diffstat (limited to 'git_misc.go')
-rw-r--r-- | git_misc.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git_misc.go b/git_misc.go index be75e40..db5ff89 100644 --- a/git_misc.go +++ b/git_misc.go @@ -19,11 +19,11 @@ var ( ) // open_git_repo opens a git repository by group and repo name. -func open_git_repo(ctx context.Context, group_name, repo_name string) (repo *git.Repository, description string, err error) { +func open_git_repo(ctx context.Context, group_name, repo_name string) (repo *git.Repository, description string, repo_id int, err error) { var fs_path string - err = database.QueryRow(ctx, "SELECT r.filesystem_path, COALESCE(r.description, '') FROM repos r JOIN groups g ON r.group_id = g.id WHERE g.name = $1 AND r.name = $2;", group_name, repo_name).Scan(&fs_path, &description) + err = database.QueryRow(ctx, "SELECT r.filesystem_path, COALESCE(r.description, ''), r.id FROM repos r JOIN groups g ON r.group_id = g.id WHERE g.name = $1 AND r.name = $2;", group_name, repo_name).Scan(&fs_path, &description, &repo_id) if err != nil { - return nil, "", err + return } repo, err = git.PlainOpen(fs_path) return |