##// END OF EJS Templates
fixed issues with support of bare-repos by vcs lib
marcink -
r2320:48d93ea1 beta
parent child Browse files
Show More
@@ -66,6 +66,7 class GitRepository(BaseRepository):
66 'config'),
66 'config'),
67 abspath(get_user_home(), '.gitconfig'),
67 abspath(get_user_home(), '.gitconfig'),
68 ]
68 ]
69 self.bare = self._repo.bare
69
70
70 @LazyProperty
71 @LazyProperty
71 def revisions(self):
72 def revisions(self):
@@ -226,9 +227,10 class GitRepository(BaseRepository):
226 try:
227 try:
227 return time.mktime(self.get_changeset().date.timetuple())
228 return time.mktime(self.get_changeset().date.timetuple())
228 except RepositoryError:
229 except RepositoryError:
230 idx_loc = '' if self.bare else '.git'
229 # fallback to filesystem
231 # fallback to filesystem
230 in_path = os.path.join(self.path, '.git', "index")
232 in_path = os.path.join(self.path, idx_loc, "index")
231 he_path = os.path.join(self.path, '.git', "HEAD")
233 he_path = os.path.join(self.path, idx_loc, "HEAD")
232 if os.path.exists(in_path):
234 if os.path.exists(in_path):
233 return os.stat(in_path).st_mtime
235 return os.stat(in_path).st_mtime
234 else:
236 else:
@@ -236,8 +238,9 class GitRepository(BaseRepository):
236
238
237 @LazyProperty
239 @LazyProperty
238 def description(self):
240 def description(self):
241 idx_loc = '' if self.bare else '.git'
239 undefined_description = u'unknown'
242 undefined_description = u'unknown'
240 description_path = os.path.join(self.path, '.git', 'description')
243 description_path = os.path.join(self.path, idx_loc, 'description')
241 if os.path.isfile(description_path):
244 if os.path.isfile(description_path):
242 return safe_unicode(open(description_path).read())
245 return safe_unicode(open(description_path).read())
243 else:
246 else:
General Comments 0
You need to be logged in to leave comments. Login now