diff options
Diffstat (limited to 'fuzz/config')
-rwxr-xr-x | fuzz/config/git-copy.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fuzz/config/git-copy.sh b/fuzz/config/git-copy.sh index a9e817e2a..f21b2d232 100755 --- a/fuzz/config/git-copy.sh +++ b/fuzz/config/git-copy.sh @@ -12,14 +12,14 @@ 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 -) +else + ACTUAL="$COMMIT" +fi if [ -f "$DIR"/.git-copy ]; then CURRENT=$(cat "$DIR"/.git-copy) - 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 -) - else - ACTUAL="$COMMIT" - fi if [ "$CURRENT" = "$ACTUAL" ]; then echo "Up to date." exit @@ -28,7 +28,7 @@ fi rm -rf "$DIR" git init -q "$DIR" -git -C "$DIR" fetch -q --depth=1 "$REPO" "$COMMIT":git-copy-tmp +git -C "$DIR" fetch -q --depth=1 "$REPO" "$ACTUAL":git-copy-tmp git -C "$DIR" reset --hard git-copy-tmp git -C "$DIR" rev-parse --verify HEAD > "$DIR"/.git-copy rm -rf "$DIR"/.git |