Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

Commit

Permalink
Store the right repo path
Browse files Browse the repository at this point in the history
  • Loading branch information
sdboyer committed Aug 1, 2016
1 parent 50171a4 commit 90a4e17
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (sm *SourceMgr) ExportProject(id ProjectIdentifier, v Version, to string) e
func (sm *SourceMgr) getProjectManager(id ProjectIdentifier) (*pmState, error) {
// TODO(sdboyer) finish this, it's not sufficient (?)
n := id.netName()
var sn string
var rpath string

// Early check to see if we already have a pm in the cache for this net name
if pm, exists := sm.pms[n]; exists {
Expand Down Expand Up @@ -289,11 +289,11 @@ func (sm *SourceMgr) getProjectManager(id ProjectIdentifier) (*pmState, error) {
rr.CloneURL.Scheme = scheme
url := rr.CloneURL.String()
sn := sanitizer.Replace(url)
path := filepath.Join(sm.cachedir, "sources", sn)
rpath = filepath.Join(sm.cachedir, "sources", sn)

if fi, err := os.Stat(path); err == nil && fi.IsDir() {
if fi, err := os.Stat(rpath); err == nil && fi.IsDir() {
// This one exists, so set up here
r, err = vcs.NewRepo(url, path)
r, err = vcs.NewRepo(url, rpath)
if err != nil {
return nil, err
}
Expand All @@ -307,9 +307,9 @@ func (sm *SourceMgr) getProjectManager(id ProjectIdentifier) (*pmState, error) {
rr.CloneURL.Scheme = scheme
url := rr.CloneURL.String()
sn := sanitizer.Replace(url)
path := filepath.Join(sm.cachedir, "sources", sn)
rpath = filepath.Join(sm.cachedir, "sources", sn)

r, err = vcs.NewRepo(url, path)
r, err = vcs.NewRepo(url, rpath)
if err != nil {
continue
}
Expand Down Expand Up @@ -373,7 +373,7 @@ decided:
an: sm.an,
dc: dc,
crepo: &repo{
rpath: sn,
rpath: rpath,
r: r,
},
}
Expand Down

0 comments on commit 90a4e17

Please sign in to comment.