Fix gitc check if gitc isn't installed
This was doing cwd.startswith(''), which is always true.
Change-Id: Icc059c09492b31e2d7651e4a595bda783c5abc47
diff --git a/repo b/repo
index ff82159..01c1cb0 100755
--- a/repo
+++ b/repo
@@ -226,6 +226,7 @@
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 @@
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 @@
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)