identity: allowed displaying an identity with an empty first field
This commit is contained in:
parent
cac0da5998
commit
971a126276
|
@ -34,8 +34,11 @@ function display_parts() {
|
||||||
local email="$3";
|
local email="$3";
|
||||||
local sigkey="$4";
|
local sigkey="$4";
|
||||||
|
|
||||||
printf "[$identity] $name <$email>";
|
if [ ! -z "$identity" ]; then
|
||||||
if [ ! -z $sigkey ]; then
|
printf "[$identity] ";
|
||||||
|
fi
|
||||||
|
printf "$name <$email>";
|
||||||
|
if [ ! -z "$sigkey" ]; then
|
||||||
printf " (signing key: $sigkey)";
|
printf " (signing key: $sigkey)";
|
||||||
fi
|
fi
|
||||||
printf "\n";
|
printf "\n";
|
||||||
|
@ -190,7 +193,7 @@ case $1 in
|
||||||
;;
|
;;
|
||||||
show)
|
show)
|
||||||
if [ -z "$2" ]; then
|
if [ -z "$2" ]; then
|
||||||
display_parts "current" "$(git config user.name)" "$(git config user.email)" "$(git config user.signingKey)";
|
display_parts "" "$(git config user.name)" "$(git config user.email)" "$(git config user.signingKey)";
|
||||||
else
|
else
|
||||||
get_identity "$2";
|
get_identity "$2";
|
||||||
display_identity "$identity";
|
display_identity "$identity";
|
||||||
|
|
Loading…
Reference in a new issue