diff options
| author | Dan Willemsen <dwillemsen@google.com> | 2015-08-31 15:45:06 -0700 |
|---|---|---|
| committer | Dan Willemsen <dwillemsen@google.com> | 2015-08-31 15:59:54 -0700 |
| commit | 2487cb7b2c41506c8ef900dba735876b01c67eab (patch) | |
| tree | 26408a8671065fbc9cd8f22e4f4e9d279fd22c3f | |
| parent | 8ce5041596ef486510245946b7c6c68ec59add29 (diff) | |
| download | git-repo-2487cb7b2c41506c8ef900dba735876b01c67eab.tar.gz | |
Fix gitc check if gitc isn't installed
This was doing cwd.startswith(''), which is always true.
Change-Id: Icc059c09492b31e2d7651e4a595bda783c5abc47
| -rwxr-xr-x | repo | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -226,6 +226,7 @@ _gitc_manifest_dir = None | |||
| 226 | def get_gitc_manifest_dir(): | 226 | def get_gitc_manifest_dir(): |
| 227 | global _gitc_manifest_dir | 227 | global _gitc_manifest_dir |
| 228 | if _gitc_manifest_dir is None: | 228 | if _gitc_manifest_dir is None: |
| 229 | _gitc_manifest_dir = '' | ||
| 229 | try: | 230 | try: |
| 230 | with open(GITC_CONFIG_FILE, 'r') as gitc_config: | 231 | with open(GITC_CONFIG_FILE, 'r') as gitc_config: |
| 231 | for line in gitc_config: | 232 | for line in gitc_config: |
| @@ -233,7 +234,7 @@ def get_gitc_manifest_dir(): | |||
| 233 | if match: | 234 | if match: |
| 234 | _gitc_manifest_dir = match.group('gitc_manifest_dir') | 235 | _gitc_manifest_dir = match.group('gitc_manifest_dir') |
| 235 | except IOError: | 236 | except IOError: |
| 236 | _gitc_manifest_dir = '' | 237 | pass |
| 237 | return _gitc_manifest_dir | 238 | return _gitc_manifest_dir |
| 238 | 239 | ||
| 239 | class CloneFailure(Exception): | 240 | class CloneFailure(Exception): |
| @@ -766,7 +767,7 @@ def main(orig_args): | |||
| 766 | my_main, my_git = _RunSelf(wrapper_path) | 767 | my_main, my_git = _RunSelf(wrapper_path) |
| 767 | 768 | ||
| 768 | cwd = os.getcwd() | 769 | cwd = os.getcwd() |
| 769 | if cwd.startswith(get_gitc_manifest_dir()): | 770 | if get_gitc_manifest_dir() and cwd.startswith(get_gitc_manifest_dir()): |
| 770 | _print('error: repo cannot be used in the GITC local manifest directory.' | 771 | _print('error: repo cannot be used in the GITC local manifest directory.' |
| 771 | '\nIf you want to work on this GITC client please rerun this ' | 772 | '\nIf you want to work on this GITC client please rerun this ' |
| 772 | 'command from the corresponding client under /gitc/', file=sys.stderr) | 773 | 'command from the corresponding client under /gitc/', file=sys.stderr) |
