checkout the right branch from the start
offlate/systems/git.py
108 | 108 | ||
109 | 109 | def clone(self, directory, callback=None): | |
110 | 110 | try: | |
111 | - | pygit2.clone_repository(self.uri, directory, callbacks=Progress(callback)) | |
111 | + | pygit2.clone_repository(self.uri, directory, callbacks=Progress(callback), | |
112 | + | checkout_branch=self.branch) | |
112 | 113 | except: | |
113 | 114 | raise ProjectNotFoundSystemException(self.name) | |
114 | - | repo = pygit2.Repository(directory) | |
115 | - | branch = repo.lookup_branch(self.branch) | |
116 | - | ref = repo.lookup_reference(branch.name) | |
117 | - | repo.checkout(ref) | |
118 | 115 | ||
119 | 116 | def update(self, callback): | |
120 | 117 | rename(self.basedir + "/current", self.basedir + "/old") |