checkout the right branch from the start

Julien LepillerSat Aug 31 13:10:36+0200 2019

9b1dab2

checkout the right branch from the start

offlate/systems/git.py

108108
109109
    def clone(self, directory, callback=None):
110110
        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)
112113
        except:
113114
            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)
118115
119116
    def update(self, callback):
120117
        rename(self.basedir + "/current", self.basedir + "/old")