diff options
Diffstat (limited to 'repo')
-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) |