filter-repo: fix --no-local error when there is no remote

Commit 011c646ee8 (filter-repo: suggest --no-local when cloning local
repos, 2020-05-15) added an additional message to the error to make it
more clear what to do when cloning local repos.  However, if there was
no remote, then the code path would run os.path.isdir(None), triggering
a traceback.  Fix the logic.

Signed-off-by: Elijah Newren <newren@gmail.com>
pull/101/head
Elijah Newren 4 years ago
parent 423b7d2c89
commit 3dfaf3874e

@ -2857,7 +2857,7 @@ class RepoFilter(object):
except subprocess.CalledProcessError as e:
output = None
msg = ""
if os.path.isdir(output):
if output and os.path.isdir(output):
msg = _("Note: when cloning local repositories, you need to pass\n"
" --no-local to git clone to avoid this issue.\n")
raise SystemExit(

Loading…
Cancel
Save