Fix gitc check if gitc isn't installed

This was doing cwd.startswith(''), which is always true.

Change-Id: Icc059c09492b31e2d7651e4a595bda783c5abc47
This commit is contained in:
Dan Willemsen 2015-08-31 15:45:06 -07:00
parent 8ce5041596
commit 2487cb7b2c

5
repo
View File

@ -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)