From 6180cf1741f67e369c84a791e87ccff813f9c097 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Wed, 29 Aug 2018 16:00:34 +1000 Subject: try: -p linux64-fuzz -u gtest -t none --- fuzz/config/git-copy.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'fuzz') diff --git a/fuzz/config/git-copy.sh b/fuzz/config/git-copy.sh index 7689abf96..2e57a6999 100755 --- a/fuzz/config/git-copy.sh +++ b/fuzz/config/git-copy.sh @@ -12,13 +12,12 @@ COMMIT="$2" DIR="$3" echo "Copy '$COMMIT' from '$REPO' to '$DIR'" -if [ $(echo -n "$COMMIT" | wc -c) != "40" ]; then - # On the off chance that $COMMIT is a remote head. - ACTUAL=$(git ls-remote "$REPO" "$COMMIT" | cut -c 1-40 -) - echo "Using commit hash '$ACTUAL'" -else +ACTUAL=$(git ls-remote "$REPO" "$COMMIT" | cut -c 1-40 -) +if [ -z "$ACTUAL" ]; then + # Use this directly on the hope that it works. ACTUAL="$COMMIT" fi +echo "Using commit hash '$ACTUAL'" if [ -f "$DIR"/.git-copy ]; then CURRENT=$(cat "$DIR"/.git-copy) if [ "$CURRENT" = "$ACTUAL" ]; then @@ -29,7 +28,7 @@ fi rm -rf "$DIR" git init -q "$DIR" -git -C "$DIR" fetch -q --depth=1 "$REPO" "$ACTUAL":git-copy-tmp -git -C "$DIR" reset --hard git-copy-tmp +git -C "$DIR" fetch -q --depth=1 "$REPO" "$ACTUAL" +git -C "$DIR" checkout "$ACTUAL" git -C "$DIR" rev-parse --verify HEAD > "$DIR"/.git-copy rm -rf "$DIR"/.git -- cgit v1.2.1