Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions src/microsoft-git/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "Microsoft Git for monorepo with GVFS support",
"id": "microsoft-git",
"version": "1.0.6",
"version": "1.0.7",
"description": "A fork of Git containing Microsoft-specific patches",
"options": {
"version": {
"type": "string",
"proposals": [
"latest",
"2.43.0.vfs.0.0",
"2.42.0.vfs.0.3",
"2.40.1.vfs.0.2",
"2.39.2.vfs.0.0",
"2.38.1.vfs.0.1"
"2.50.1.vfs.0.2",
"2.50.1.vfs.0.1",
"2.50.1.vfs.0.0",
"2.49.0.vfs.0.4",
"2.49.0.vfs.0.3"
],
"default": "latest",
"description": "Select version of Microsoft Git, if not latest."
Expand Down
12 changes: 9 additions & 3 deletions src/microsoft-git/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,21 @@ fi
# Partial version matching
if [ "$(echo "${GIT_VERSION}" | grep -o '\.' | wc -l)" != "2" ]; then
requested_version="${GIT_VERSION}"
version_list="$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/microsoft/git/tags?per_page=100" | grep -oP '"name":\s*"v\K[0-9]+\.[0-9]+\.[0-9]+\.vfs\.[0-9]+\.[0-9]+"' | tr -d '"' | sort -rV)"
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "lts" ] || [ "${requested_version}" = "current" ]; then
GIT_VERSION="$(echo "${version_list}" | head -n 1)"
# For latest, lts, and current, use the releases API to get the actual latest release
GIT_VERSION="$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/microsoft/git/releases/latest" | grep -oP '"tag_name":\s*"v\K[0-9]+\.[0-9]+\.[0-9]+\.vfs\.[0-9]+\.[0-9]+"' | tr -d '"')"
else
# For partial versions, use the existing tags logic
version_list="$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/microsoft/git/tags?per_page=100" | grep -oP '"name":\s*"v\K[0-9]+\.[0-9]+\.[0-9]+\.vfs\.[0-9]+\.[0-9]+"' | tr -d '"' | sort -rV)"
set +e
GIT_VERSION="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")"
set -e
if [ -z "${GIT_VERSION}" ] || ! echo "${version_list}" | grep "^${GIT_VERSION//./\\.}$" > /dev/null 2>&1; then
echo "Invalid git version: ${requested_version}" >&2
exit 1
fi
fi
if [ -z "${GIT_VERSION}" ] || ! echo "${version_list}" | grep "^${GIT_VERSION//./\\.}$" > /dev/null 2>&1; then
if [ -z "${GIT_VERSION}" ]; then
echo "Invalid git version: ${requested_version}" >&2
exit 1
fi
Expand Down