Skip to content
Merged
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
4 changes: 3 additions & 1 deletion tools/refresh-binding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ resolve_repo() { # name url ref existing_path -> echoes absolute path
git -C "$dir" fetch --quiet "$url" "$ref"
git -C "$dir" checkout --quiet FETCH_HEAD
else
# --branch takes a branch or a tag, so a pinned binding's commit SHA falls through to a
# full clone -- which lands on the default branch and must still be moved onto the ref.
git clone --quiet --depth 1 --branch "$ref" "$url" "$dir" 2>/dev/null \
|| git clone --quiet "$url" "$dir" # fall back to full clone for a non-branch ref
|| { git clone --quiet "$url" "$dir" && git -C "$dir" checkout --quiet "$ref"; }
fi
(cd "$dir" && pwd)
}
Expand Down
Loading