@@ -36,14 +36,14 @@ class Store(object):
3636 get_default_directory = staticmethod (_get_default_directory )
3737
3838 class RepoPathGetter (object ):
39- def __init__ (self , repo , sha , store ):
39+ def __init__ (self , repo , ref , store ):
4040 self ._repo = repo
41- self ._sha = sha
41+ self ._ref = ref
4242 self ._store = store
4343
4444 @cached_property
4545 def repo_path (self ):
46- return self ._store .clone (self ._repo , self ._sha )
46+ return self ._store .clone (self ._repo , self ._ref )
4747
4848 def __init__ (self , directory = None ):
4949 if directory is None :
@@ -97,15 +97,15 @@ def require_created(self):
9797 self ._create ()
9898 self .__created = True
9999
100- def clone (self , url , sha ):
101- """Clone the given url and checkout the specific sha ."""
100+ def clone (self , url , ref ):
101+ """Clone the given url and checkout the specific ref ."""
102102 self .require_created ()
103103
104104 # Check if we already exist
105105 with sqlite3 .connect (self .db_path ) as db :
106106 result = db .execute (
107107 'SELECT path FROM repos WHERE repo = ? AND ref = ?' ,
108- [url , sha ],
108+ [url , ref ],
109109 ).fetchone ()
110110 if result :
111111 return result [0 ]
@@ -118,18 +118,18 @@ def clone(self, url, sha):
118118 'git' , 'clone' , '--no-checkout' , url , dir , env = no_git_env (),
119119 )
120120 with cwd (dir ):
121- cmd_output ('git' , 'reset' , sha , '--hard' , env = no_git_env ())
121+ cmd_output ('git' , 'reset' , ref , '--hard' , env = no_git_env ())
122122
123123 # Update our db with the created repo
124124 with sqlite3 .connect (self .db_path ) as db :
125125 db .execute (
126126 'INSERT INTO repos (repo, ref, path) VALUES (?, ?, ?)' ,
127- [url , sha , dir ],
127+ [url , ref , dir ],
128128 )
129129 return dir
130130
131- def get_repo_path_getter (self , repo , sha ):
132- return self .RepoPathGetter (repo , sha , self )
131+ def get_repo_path_getter (self , repo , ref ):
132+ return self .RepoPathGetter (repo , ref , self )
133133
134134 @cached_property
135135 def cmd_runner (self ):
0 commit comments