This commit is contained in:
Jabberwocky238
2026-07-16 09:14:16 -04:00
parent c64116069e
commit a289f1b911
4 changed files with 55 additions and 41 deletions
+5 -5
View File
@@ -106,7 +106,7 @@ func (s *LocalState) nextNamespaceID() (int64, error) {
// namespace must already exist (have at least one repo) so NamespaceID can be
// resolved; NameID is freshly assigned. skip-auth: disk-only (git init, no DB).
func (s *LocalState) CreateRepo(ns, name string) error {
path, err := s.RepoPath(ns, name)
path, err := s.cfg.RepoPath(ns, name)
if err != nil {
return err
}
@@ -157,7 +157,7 @@ func (s *LocalState) ExistRepo(ns, name string) error {
// DeleteRepo removes the repo row, its repo-targeted ACL grants, and the
// on-disk bare directory. Hard-deletes. skip-auth: disk-only.
func (s *LocalState) DeleteRepo(ns, name string) error {
path, _ := s.RepoPath(ns, name)
path, _ := s.cfg.RepoPath(ns, name)
r, err := s.findRepo(ns, name)
if err != nil {
return err
@@ -186,11 +186,11 @@ func (s *LocalState) MoveRepo(old, new string) error {
if err != nil {
return err
}
oldPath, err := s.RepoPath(oldNs, oldName)
oldPath, err := s.cfg.RepoPath(oldNs, oldName)
if err != nil {
return err
}
newPath, err := s.RepoPath(newNs, newName)
newPath, err := s.cfg.RepoPath(newNs, newName)
if err != nil {
return err
}
@@ -207,7 +207,7 @@ func (s *LocalState) MoveRepo(old, new string) error {
if err != nil {
return err
}
upd := Repo{Namespace: newNs, Name: normalizeName(newName)}
upd := Repo{Namespace: newNs, Name: strings.TrimSuffix(newName, ".git")}
cols := []string{"namespace", "name"}
if newNs != oldNs {
nsID, err := s.resolveNamespaceID(newNs)