| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0b820e6 commit 5991698
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,6 +71,7 @@ class Repo(object): | |||
| 71 | 71 | re_hexsha_shortened = re.compile('^[0-9A-Fa-f]{4,40}$') | |
| 72 | 72 | re_author_committer_start = re.compile(r'^(author|committer)') | |
| 73 | 73 | re_tab_full_line = re.compile(r'^\t(.*)$') | |
| 74 | + re_git_file_gitdir = re.compile('gitdir: (.*)') | ||
| 74 | 75 | ||
| 75 | 76 | # invariants | |
| 76 | 77 | # represents the configuration level of a configuration file | |
@@ -113,6 +114,17 @@ def __init__(self, path=None, odbt = DefaultDBType): | |||
| 113 | 114 | self.git_dir = gitpath | |
| 114 | 115 | self._working_tree_dir = curpath | |
| 115 | 116 | break | |
| 117 | + if isfile(gitpath): | ||
| 118 | + line = open(gitpath, 'r').readline().strip() | ||
| 119 | + match = self.re_git_file_gitdir.match(line) | ||
| 120 | + if match: | ||
| 121 | + gitpath = match.group(1) | ||
| 122 | + if not os.path.isabs(gitpath): | ||
| 123 | + gitpath = os.path.normpath(join(curpath, gitpath)) | ||
| 124 | + if is_git_dir(gitpath): | ||
| 125 | + self.git_dir = gitpath | ||
| 126 | + self._working_tree_dir = curpath | ||
| 127 | + break | ||
| 116 | 128 | curpath, dummy = os.path.split(curpath) | |
| 117 | 129 | if not dummy: | |
| 118 | 130 | break | |
| Back | FazBrowse Home | New Git URL |
0 commit comments