Leave sanitize-commit's $target undefined when no branch is given


It was previously unconditionally set, either to false or to the
branch passed on the command line; but code tests it using
defined($target), which was thus always true. Apparently the intent
was to leave it undefined when no branch was given.

Exposed by configuring my local repositories for picked modules to
have with-pickbot enabled. This script is used as post-commit hook,
passing only one argument, without the extra arguments the Qt Sanity
bot on Gerrit passes, notably the one that supplies $target's value.
The with-pickbot code thus got exercised in a new way, leading to a
bogus warning.

Change-Id: If4e035300d6017a7398e995be96e3dee2a0969ed
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
commit10d4124a82b1c52dbd35639e20895bb111b58245
parent447398a2d6f357bc381ea8464faec6226f2cfe97
authorEdward Welbourne <edward.welbourne@qt.io>
committerEdward Welbourne <edward.welbourne@qt.io>
commit timeTue, 3 May 2022 13:28:09 +0000