diff options
| author | Jeff Carr <[email protected]> | 2024-11-22 08:44:49 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-22 08:44:49 -0600 |
| commit | 03eb4fb389a671c64c35ca486cfe762fef087eab (patch) | |
| tree | 1321d3af4ddc8b3e1b1f0f317039dff0b86acdd0 /readonly.go | |
| parent | 3e0e1b4531b45f3399dc6a2e9632bc88b609fa0b (diff) | |
IsPrivate() and IsReadOnly() seems to workv0.0.3
Diffstat (limited to 'readonly.go')
| -rw-r--r-- | readonly.go | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/readonly.go b/readonly.go index 27e23ee..9d0c1e9 100644 --- a/readonly.go +++ b/readonly.go @@ -1,6 +1,8 @@ package forgepb -import "strings" +import ( + "strings" +) func (all *Repos) UpdateGoPath(name string, gopath string) bool { oldr := all.DeleteByPath(name) @@ -43,6 +45,11 @@ func (all *Repos) IsReadOnly(gopath string) bool { } } + if match == nil { + // log.Info("did not match in IsReadOnly()", gopath) + return true + } + // take the settings from the directory match if match.Writable { return false @@ -63,6 +70,9 @@ func (all *Repos) IsReadOnly(gopath string) bool { func (all *Repos) IsPrivate(gopath string) bool { var match *Repo + // sort by path means the simple 'match' logic + // here works in the sense the last directory match + // is the one that is used loop := all.SortByPath() // get the list of repos for loop.Scan() { r := loop.Repo() @@ -81,11 +91,11 @@ func (all *Repos) IsPrivate(gopath string) bool { } } } - - if match.Private { - return true + if match == nil { + // log.Info("did not match in IsPrivate()", gopath) + return false } // otherwise, assume not private - return true + return match.Private } |
