Klaus Demo klaus / e0f290d
Fix repo name if repo path is a ".git" directory /path/to/some/repo/.git should have the name "repo" Fixes #86. Thanks to @Dafvid for the initial patch. Jonas Haag 6 years ago
1 changed file(s) with 4 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1010 # TODO: factor out stuff into dulwich
1111 @property
1212 def name(self):
13 return self.path.rstrip(os.sep).split(os.sep)[-1].replace('.git', '')
13 # 1. /x/y.git -> /x/y and /x/y/.git/ -> /x/y//
14 # 2. /x/y/ -> /x/y
15 # 3. /x/y -> y
16 return self.path.replace(".git", "").rstrip(os.sep).split(os.sep)[-1]
1417
1518 def get_last_updated_at(self):
1619 refs = [self[ref_hash] for ref_hash in self.get_refs().itervalues()]