/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to transportgit.py

Avoid loading bzr-git/dulwich when not necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 
50
50
    def __init__(self, transport):
51
51
        self.transport = transport
52
 
        if self.transport.has(".git/info/refs"):
53
 
            self.bare = False
54
 
            self._controltransport = self.transport.clone('.git')
55
 
        elif self.transport.has("info/refs"):
56
 
            self.bare = True
57
 
            self._controltransport = self.transport
58
 
        else:
 
52
        try:
 
53
            if self.transport.has(".git/info/refs"):
 
54
                self.bare = False
 
55
                self._controltransport = self.transport.clone('.git')
 
56
            elif self.transport.has("info/refs"):
 
57
                self.bare = True
 
58
                self._controltransport = self.transport
 
59
            else:
 
60
                raise NotGitRepository(self.transport)
 
61
        except NoSuchFile:
59
62
            raise NotGitRepository(self.transport)
60
63
        object_store = TransportObjectStore(
61
64
            self._controltransport.clone(OBJECTDIR))