Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions bin/check_git
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ print_usage() {
echo " '-b', '-B', '-t' and '-T' are mutually exclusive."
echo

echo " -B [<branch>] Check if repository is checkout out on the specified branch."
echo " -B <branch> Check if repository is checkout out on the specified branch."
echo " '-b', '-B', '-t' and '-T' are mutually exclusive."
echo

Expand All @@ -221,7 +221,7 @@ print_usage() {
echo " '-b', '-B', '-t' and '-T' are mutually exclusive."
echo

echo " -T [<tag>] Check if repository is checkout out on the specified tag."
echo " -T <tag> Check if repository is checkout out on the specified tag."
echo " No detached HEAD or branch."
echo " '-b', '-B', '-t' and '-T' are mutually exclusive."
echo
Expand Down Expand Up @@ -496,7 +496,7 @@ get_current_branch() {
get_current_tag() {
_path="${1}"

_tag="$( run "cd ${_path} && git log --pretty=format:'%d' --abbrev-commit --date=short -1 | grep -Eo 'tag:.*?,' | sed 's/,.*$//g' | sed 's/tag:[[:space:]]*//g'" )"
_tag="$( run "cd ${_path} && git log --pretty=format:'%d%n' --abbrev-commit --date=short -1 | grep -Eo 'tag:.*' | sed 's/[,)].*$//;s/tag:[[:space:]]*//'" )"
if [ "${_tag}" = "" ]; then
echo
return 1
Expand Down Expand Up @@ -543,8 +543,8 @@ _gpg_get_HEAD_raw_gpg_info() {

# If currently on a tag, verify this tag
if get_current_tag "${_path}" >/dev/null 2>&1; then
_tag="$( run "cd ${_path} && git tag --contains" )"
_gpg="$( run "cd ${_path} && git verify-tag --raw ${_tag} 2>&1 || true" )"
_tag="$( run "cd ${_path} && git tag --contains" | head -1)"
_gpg="$( run "cd ${_path} && git verify-tag --raw ${_tag} 2>&1 | grep -v 'cannot verify a non-tag object of type commit' || true" )"

# If not on a tag, get current commit and verify it
else
Expand Down Expand Up @@ -1245,10 +1245,10 @@ fi
## 07. Log to file or output?
##
if [ "${OUTPUT_LOGFILE}" = "1" ]; then
echo "${PROGRAM_EXIT_TEXT}" > "${OUTPUT_LOGFILE_NAME}"
printf "%s\n" "${PROGRAM_EXIT_TEXT}" > "${OUTPUT_LOGFILE_NAME}"
echo "${PROGRAM_EXIT_CODE}" >> "${OUTPUT_LOGFILE_NAME}"
exit "${EXIT_SUCC}"
else
printf "%s${PROGRAM_EXIT_TEXT}\n" ""
printf "%s\n" "${PROGRAM_EXIT_TEXT}"
exit "${PROGRAM_EXIT_CODE}"
fi