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
5 changes: 3 additions & 2 deletions third_party/s2n-bignum/import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ set -euo pipefail
# either set GITHUB_TARGET or GITHUB_REPOSITORY as below:
#
# ```
# GITHUB_REPOSITORY=<repo owner>/<repo name> GITHUB_TARGET=<branch or tag> ./import.sh
# GITHUB_REPOSITORY=<repo owner>/<repo name> GITHUB_TARGET=<branch or tag> COMMIT_HASH=<commit hash> ./import.sh
# ```

GITHUB_SERVER_URL="https://github.com/"
GITHUB_REPOSITORY=${GITHUB_REPOSITORY:=awslabs/s2n-bignum.git}
GITHUB_TARGET=${GITHUB_TARGET:=main}
COMMIT_HASH=${COMMIT_HASH:=HEAD}

SRC="s2n-bignum-imported"
TMP="TEMP_CAN_DELETE"
Expand All @@ -49,7 +50,7 @@ mkdir ${TMP}

echo "Fetching repository ..."
git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} ${TMP} --branch ${GITHUB_TARGET} --single-branch > /dev/null
GITHUB_COMMIT=$(cd ${TMP} >/dev/null; git rev-parse HEAD)
GITHUB_COMMIT=$(cd ${TMP} > /dev/null; git checkout ${COMMIT_HASH} > /dev/null; git rev-parse HEAD)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Follow the mlkem-native importer and only import the exact commit you care about. At the same time, remove distinction between GITHUB_TARGET and COMMIT_HASH:

git init >/dev/null
git remote add origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY >/dev/null
git fetch origin --depth 1 $GITHUB_SHA >/dev/null
git checkout FETCH_HEAD >/dev/null


echo "Cloned s2n-bignum folder"
ls -la ${TMP}
Expand Down
Loading