From d640cbbba0a987350f15f74100446881e61731bd Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Tue, 20 Feb 2018 17:22:58 +0100 Subject: [PATCH] Fix if the entry exists in pdc and not on disk and typo in an error message --- roles/distgit/files/mass-branching-git.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/distgit/files/mass-branching-git.py b/roles/distgit/files/mass-branching-git.py index cad68f4b60..7ae950a54e 100644 --- a/roles/distgit/files/mass-branching-git.py +++ b/roles/distgit/files/mass-branching-git.py @@ -36,6 +36,10 @@ def _get_arguments(): def create_git_branch(path, gitbranch): """ Create the specified git branch in the specified git repository. """ + if not os.path.isdir(path): + print(' ERROR: %s does not appear to be a directory' % path) + return + cmd = ['git', 'branch', gitbranch, _branch_from] return subprocess.check_output( cmd, stderr=subprocess.STDOUT, shell=False, cwd=path) @@ -70,7 +74,7 @@ def main(): except subprocess.CalledProcessError as err: print( ' ERROR: %s failed to branch, return code: %s\n %s' % ( - err.returncode, err.output)) + entry, err.returncode, err.output)) return 0