summaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorMartin Thomson <martin.thomson@gmail.com>2018-08-29 16:00:34 +1000
committerMartin Thomson <martin.thomson@gmail.com>2018-08-29 16:00:34 +1000
commit6180cf1741f67e369c84a791e87ccff813f9c097 (patch)
tree05b10ff6a6b864ecad4e6c2cdf2a276f5bb553de /fuzz
parent791519cafa453c5d2cceb2b6a11b36f1903b0d6d (diff)
downloadnss-hg-6180cf1741f67e369c84a791e87ccff813f9c097.tar.gz
try: -p linux64-fuzz -u gtest -t none
Diffstat (limited to 'fuzz')
-rwxr-xr-xfuzz/config/git-copy.sh13
1 files changed, 6 insertions, 7 deletions
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