Return TRUE if the given path is a git directory (/path/to/dir/.git). This won't automatically add ".git" to a directory.
(path)
| 143 | |
| 144 | |
| 145 | def git_dir(path): |
| 146 | """Return TRUE if the given path is a git directory (/path/to/dir/.git). |
| 147 | This won't automatically add ".git" to a directory. |
| 148 | """ |
| 149 | d = read_pipe(["git", "--git-dir", path, "rev-parse", "--git-dir"], True).strip() |
| 150 | if not d or len(d) == 0: |
| 151 | return None |
| 152 | else: |
| 153 | return d |
| 154 | |
| 155 | |
| 156 | def chdir(path, is_client_path=False): |
no test coverage detected