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
8 changes: 7 additions & 1 deletion src/microsoft-git/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ Scalar and support for GVFS protocol.

## OS Support

This feature is tested on base images for Debian/Ubuntu and Mariner-CBL 2.0
This feature is tested on base images for Debian/Ubuntu and Mariner-CBL 2.0

On Debian/Ubuntu, the installer supports current
`microsoft-git_<version>_linux_<architecture>.deb` release assets and older
`microsoft-git_<version>_<architecture>.deb` assets. Legacy
`microsoft-git_<version>.deb` assets are supported on amd64 only; they are not
architecture-independent packages.
2 changes: 1 addition & 1 deletion src/microsoft-git/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Microsoft Git for monorepo with GVFS support",
"id": "microsoft-git",
"version": "1.0.10",
"version": "1.0.11",
"description": "A fork of Git containing Microsoft-specific patches",
"options": {
"version": {
Expand Down
39 changes: 25 additions & 14 deletions src/microsoft-git/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ echo "Downloading Microsoft Git ${GIT_VERSION}..."

if command -v tdnf >/dev/null 2>&1; then
# We need to build Git from source release on Mariner
tdnf install -y wget tar git pcre2 binutils build-essential openssl-devel expat-devel curl-devel python3-devel gettext asciidoc xmlto cronie
tdnf install -y wget tar git pcre2 binutils build-essential rust openssl-devel expat-devel curl-devel python3-devel gettext asciidoc xmlto cronie
wget -q https://github.com/microsoft/git/archive/refs/tags/v${GIT_VERSION}.tar.gz
tar xvf v${GIT_VERSION}.tar.gz -C /usr
rm v${GIT_VERSION}.tar.gz
Expand All @@ -87,21 +87,32 @@ fi
# Install for Debian/Ubuntu
check_packages wget git

# Detect host architecture for arch-specific .deb packages (added in v2.52.0.vfs.0.5+)
# Support current Linux names, older arch-specific names, and legacy amd64 packages.
ARCH="$(dpkg --print-architecture)"
DEB_URL="https://github.com/microsoft/git/releases/download/v${GIT_VERSION}/microsoft-git_${GIT_VERSION}_${ARCH}.deb"
DEB_FILE="microsoft-git_${GIT_VERSION}_${ARCH}.deb"

# Try arch-specific .deb first, fall back to legacy amd64 .deb for older releases
if ! wget -q "${DEB_URL}" -O "${DEB_FILE}" 2>/dev/null; then
if [ "${ARCH}" != "amd64" ]; then
echo "Could not download Microsoft Git ${GIT_VERSION} package for architecture ${ARCH}." >&2
echo "Older Microsoft Git releases only published legacy amd64 Debian package assets." >&2
exit 1
DEB_FILES=(
"microsoft-git_${GIT_VERSION}_linux_${ARCH}.deb"
"microsoft-git_${GIT_VERSION}_${ARCH}.deb"
)
if [ "${ARCH}" = "amd64" ]; then
DEB_FILES+=("microsoft-git_${GIT_VERSION}.deb")
fi

DEB_FILE=""
for candidate in "${DEB_FILES[@]}"; do
DEB_URL="https://github.com/microsoft/git/releases/download/v${GIT_VERSION}/${candidate}"
echo "Trying ${DEB_URL}..."
if wget -q "${DEB_URL}" -O "${candidate}" 2>/dev/null; then
DEB_FILE="${candidate}"
break
fi
DEB_URL="https://github.com/microsoft/git/releases/download/v${GIT_VERSION}/microsoft-git_${GIT_VERSION}.deb"
DEB_FILE="microsoft-git_${GIT_VERSION}.deb"
wget -q "${DEB_URL}" -O "${DEB_FILE}"
rm -f "${candidate}"
done

if [ -z "${DEB_FILE}" ]; then
echo "Could not download Microsoft Git ${GIT_VERSION} package for architecture ${ARCH}." >&2
echo "Attempted Debian package assets: ${DEB_FILES[*]}" >&2
echo "Legacy packages without an architecture suffix are only supported on amd64." >&2
exit 1
fi

dpkg -i "${DEB_FILE}"
Expand Down
10 changes: 10 additions & 0 deletions test/microsoft-git/linux_named_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -e

source dev-container-features-test-lib

check "git version" test "$(git --version)" = "git version 2.56.0.vfs.0.2"
check "scalar available" bash -c "command -v scalar && scalar version"

reportResults
10 changes: 10 additions & 0 deletions test/microsoft-git/old_arch_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -e

source dev-container-features-test-lib

check "git version" test "$(git --version)" = "git version 2.55.0.vfs.0.10"
check "scalar available" bash -c "command -v scalar && scalar version"

reportResults
16 changes: 16 additions & 0 deletions test/microsoft-git/scenarios.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
{
"linux_named_deb": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu24.04",
"features": {
"microsoft-git": {
"version": "2.56.0.vfs.0.2"
}
}
},
"old_arch_deb": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu24.04",
"features": {
"microsoft-git": {
"version": "2.55.0.vfs.0.10"
}
}
},
"latest_stable": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
Expand Down
Loading