summaryrefslogtreecommitdiff
path: root/repo.new.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-11 13:40:48 -0500
committerJeff Carr <[email protected]>2025-09-11 13:40:48 -0500
commite395456c536b2458563d5e872a73e8667cc08659 (patch)
treec9976e9faecac92aeda0aca2cf60ee03a4890f1e /repo.new.go
parentcb604213743839453565a58afbb72bb63a66a9e1 (diff)
cleaning up .git/config parsing
Diffstat (limited to 'repo.new.go')
-rw-r--r--repo.new.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/repo.new.go b/repo.new.go
index 453fa0a..c48fde7 100644
--- a/repo.new.go
+++ b/repo.new.go
@@ -100,3 +100,19 @@ func (all *Repos) NewRepo(fullpath string, namespace string) (*Repo, error) {
// todo: use Repos.Lock()
return nil, errors.New("gitpb.NewRepo() append failed " + fullpath)
}
+
+func NewRepo(fullpath string) (*Repo, error) {
+ // add a new one here
+ newr := Repo{
+ FullPath: fullpath,
+ }
+ newr.Times = new(GitTimes)
+
+ // everything happens in here
+ newr.Reload()
+ newr.ValidateUTF8()
+ if newr.Namespace == "" {
+ log.Info("GET Namespace from URL", newr.GetURL())
+ }
+ return &newr, nil
+}