From 2487cb7b2c41506c8ef900dba735876b01c67eab Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 31 Aug 2015 15:45:06 -0700 Subject: Fix gitc check if gitc isn't installed This was doing cwd.startswith(''), which is always true. Change-Id: Icc059c09492b31e2d7651e4a595bda783c5abc47 --- repo | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/repo b/repo index ff82159d..01c1cb0e 100755 --- a/repo +++ b/repo @@ -226,6 +226,7 @@ _gitc_manifest_dir = None def get_gitc_manifest_dir(): global _gitc_manifest_dir if _gitc_manifest_dir is None: + _gitc_manifest_dir = '' try: with open(GITC_CONFIG_FILE, 'r') as gitc_config: for line in gitc_config: @@ -233,7 +234,7 @@ def get_gitc_manifest_dir(): if match: _gitc_manifest_dir = match.group('gitc_manifest_dir') except IOError: - _gitc_manifest_dir = '' + pass return _gitc_manifest_dir class CloneFailure(Exception): @@ -766,7 +767,7 @@ def main(orig_args): my_main, my_git = _RunSelf(wrapper_path) cwd = os.getcwd() - if cwd.startswith(get_gitc_manifest_dir()): + if get_gitc_manifest_dir() and cwd.startswith(get_gitc_manifest_dir()): _print('error: repo cannot be used in the GITC local manifest directory.' '\nIf you want to work on this GITC client please rerun this ' 'command from the corresponding client under /gitc/', file=sys.stderr) -- cgit v1.2.3-54-g00ecf