Skip to content

Commit

Permalink
[IMP] Harve
Browse files Browse the repository at this point in the history
 - Don't log the GH_TOKEN env variable in debug mode.
 - Allow to specify the searched commit.
  • Loading branch information
KangOl committed May 23, 2023
1 parent c14cae6 commit ddb5dd4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Harve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

set -euo pipefail

test "${DEBUG:-0}" != 0 && set -x

: "${GH_TOKEN:?Please set a GH_TOKEN environment variable}"

test "${DEBUG:-0}" != 0 && set -x

# Ensure minimal git version
printf '%s\n%s\n' 2.23 "$(git --version | cut -d" " -f3)" | sort --check=quiet --version-sort || \
{ echo "ERROR: outdated git version. Git >= 2.23 is required." >&2; exit 1; }
Expand Down Expand Up @@ -68,7 +68,8 @@ $git fetch --all --prune --quiet --no-auto-gc --multiple --jobs="$jobs" 2>/dev/n
rm -f "$workdir/.git/gc.log"
$git gc --quiet

: ${COMMIT:=4295585aff34ba9881ed7f64bce3481e3d217dcd}
set -x
# The search for the hash will return an error if not found. That the inverse of what we want.
$git branch --all --contains 4295585aff34ba9881ed7f64bce3481e3d217dcd || exit 0
$git branch --all --contains "${COMMIT}" || exit 0
exit 1

0 comments on commit ddb5dd4

Please sign in to comment.