From 3dfaf3874e1c41887f4a53b753292d1887278ee1 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Mon, 18 May 2020 23:15:07 -0700 Subject: [PATCH] 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 --- git-filter-repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-filter-repo b/git-filter-repo index fba355a..41aca6a 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -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(