From 9b725917fdf54d208c7d12b289ec5183e2420889 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Tue, 3 Jan 2017 11:22:05 +0100 Subject: [PATCH] Do not try to change directory when running Phan tests with no params When running tests with: PHAN=/path/to/phan/phan /path/to/mediawiki-core/tests/phan/bin/phan the script changes to the home dir (does "cd" with no param), which results in git error message (unless the home dir happens to be a git repository). Change-Id: Ib11e419fb5cca51ceaed0e9c7c86ae9c5c4ae0f2 --- tests/phan/bin/phan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phan/bin/phan b/tests/phan/bin/phan index 6ce1e8419b..61ad7da969 100755 --- a/tests/phan/bin/phan +++ b/tests/phan/bin/phan @@ -31,7 +31,7 @@ fi # If the first argument doesn't start with a -, then it's a path # to another project (extension, skin, etc.) to analyze -if [[ "$1" != "-"* ]]; then +if [[ -n "$1" && "$1" != "-"* ]]; then cd $1 shift else -- 2.20.1