mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-06 00:39:44 +01:00
Simplify check for git working tree
Sending the entire log to /dev/null is a rather expensive way of checking whether we are inside a git working tree. Use `git rev-parse --is-inside-work-tree` instead.
This commit is contained in:
parent
f6571c7c76
commit
1e3f932932
@ -127,7 +127,7 @@ declare -r SWCONTACT="dirk aet testssl dot sh"
|
|||||||
[[ "$VERSION" =~ dev|rc|beta ]] && \
|
[[ "$VERSION" =~ dev|rc|beta ]] && \
|
||||||
SWURL="https://testssl.sh/dev/" ||
|
SWURL="https://testssl.sh/dev/" ||
|
||||||
SWURL="https://testssl.sh/"
|
SWURL="https://testssl.sh/"
|
||||||
if git log &>/dev/null; then
|
if git rev-parse --is-inside-work-tree &>/dev/null; then
|
||||||
declare -r GIT_REL="$(git log --format='%h %ci' -1 2>/dev/null | awk '{ print $1" "$2" "$3 }')"
|
declare -r GIT_REL="$(git log --format='%h %ci' -1 2>/dev/null | awk '{ print $1" "$2" "$3 }')"
|
||||||
declare -r GIT_REL_SHORT="$(git log --format='%h %ci' -1 2>/dev/null | awk '{ print $1 }')"
|
declare -r GIT_REL_SHORT="$(git log --format='%h %ci' -1 2>/dev/null | awk '{ print $1 }')"
|
||||||
declare -r REL_DATE="$(git log --format='%h %ci' -1 2>/dev/null | awk '{ print $2 }')"
|
declare -r REL_DATE="$(git log --format='%h %ci' -1 2>/dev/null | awk '{ print $2 }')"
|
||||||
|
Loading…
Reference in New Issue
Block a user