@@ -781,7 +781,8 @@ def fromurl(cls, url, path=None):
781
781
repo .rev = m_repo_url .group (3 )
782
782
else :
783
783
error ('Invalid repository (%s)' % url .strip (), - 1 )
784
- repo .cache = Global ().get_cfg ('CACHE' )
784
+
785
+ repo .cache = Program (repo .path ).get_cfg ('CACHE' )
785
786
786
787
return repo
787
788
@@ -1016,12 +1017,12 @@ def rm_untracked(self):
1016
1017
1017
1018
def get_cache (self , url ):
1018
1019
up = urlparse (formaturl (url , 'https' ))
1019
- if self .cache and up and os .path .isdir (os .path .join (self .cache , up .netloc , re .sub (r'^/' , '' , up .path ))):
1020
+ if self .cache and up and up . netloc and os .path .isdir (os .path .join (self .cache , up .netloc , re .sub (r'^/' , '' , up .path ))):
1020
1021
return os .path .join (self .cache , up .netloc , re .sub (r'^/' , '' , up .path ))
1021
1022
1022
1023
def set_cache (self , url ):
1023
1024
up = urlparse (formaturl (url , 'https' ))
1024
- if self .cache and up and os .path .isdir (self .path ):
1025
+ if self .cache and up and up . netloc and os .path .isdir (self .path ):
1025
1026
cpath = os .path .join (self .cache , up .netloc , re .sub (r'^/' , '' , up .path ))
1026
1027
if not os .path .isdir (cpath ):
1027
1028
os .makedirs (cpath )
0 commit comments