diff options
| author | Jeff Carr <[email protected]> | 2025-08-31 12:24:56 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-31 12:24:56 -0500 |
| commit | 4fcc1e0349c8a0f13023639e17561bbcb050bffb (patch) | |
| tree | 09ccabdc8e32b528fd21efdc4ed1607e8418fa5b /goSrcScan.go | |
| parent | a1bab321212258cca84a14832f3ce7fe46bc5f43 (diff) | |
fixes for Append()
Diffstat (limited to 'goSrcScan.go')
| -rw-r--r-- | goSrcScan.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/goSrcScan.go b/goSrcScan.go index 5555ac5..2eac3e6 100644 --- a/goSrcScan.go +++ b/goSrcScan.go @@ -178,3 +178,24 @@ func (f *Forge) checkpath(gopath string, url string) (*gitpb.Repo, error) { } return repo, err } + +// deletes the repo from the protobuf (pray your mutex locks are working) +// re-scans the repo +// returns the new repo +func (f *Forge) ReAdd(repo *gitpb.Repo) (*gitpb.Repo, error) { + if repo == nil { + return nil, log.Errorf("can't delete repo == nil") + } + fullpath := repo.GetFullPath() + ns := repo.GetNamespace() + if !f.Repos.Delete(repo) { + return nil, log.Errorf("delete of repo failed") + } + + repo, err := f.AddNamespaceDir(ns, fullpath) + if err != nil { + log.Info("ReAdd() error", fullpath, err) + return nil, err + } + return repo, err +} |
