aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2023-01-11 22:02:28 +0300
committerGitHub <noreply@github.com>2023-01-11 22:02:28 +0300
commit74dd2710dc77b85d6ad72c4534f4c7d7f67b86b2 (patch)
tree678fbd7d7d1cee3e3d53d0f4f0a66c6273bb8c11
parente67f4dc0fd053d7bac56a8c802b3a1af68da5bf6 (diff)
Git: Use sysconfdir=/etc for git built from source (#395)
* Git: Adds a new 'addGitConfigSymlink' option * Use sysconfdir
-rw-r--r--src/git/devcontainer-feature.json2
-rwxr-xr-xsrc/git/install.sh2
-rw-r--r--test/git/install_git_from_src.sh8
3 files changed, 10 insertions, 2 deletions
diff --git a/src/git/devcontainer-feature.json b/src/git/devcontainer-feature.json
index ea35c4b..4123aed 100644
--- a/src/git/devcontainer-feature.json
+++ b/src/git/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "git",
- "version": "1.1.3",
+ "version": "1.1.4",
"name": "Git (from source)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/git",
"description": "Install an up-to-date version of Git, built from source as needed. Useful for when you want the latest and greatest features. Auto-detects latest stable version and installs needed dependencies.",
diff --git a/src/git/install.sh b/src/git/install.sh
index 52081f1..679e497 100755
--- a/src/git/install.sh
+++ b/src/git/install.sh
@@ -144,7 +144,7 @@ echo "Downloading source for ${GIT_VERSION}..."
curl -sL https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz | tar -xzC /tmp 2>&1
echo "Building..."
cd /tmp/git-${GIT_VERSION}
-make -s USE_LIBPCRE=YesPlease prefix=/usr/local all && make -s USE_LIBPCRE=YesPlease prefix=/usr/local install 2>&1
+make -s USE_LIBPCRE=YesPlease prefix=/usr/local sysconfdir=/etc all && make -s USE_LIBPCRE=YesPlease prefix=/usr/local sysconfdir=/etc install 2>&1
rm -rf /tmp/git-${GIT_VERSION}
rm -rf /var/lib/apt/lists/*
echo "Done!"
diff --git a/test/git/install_git_from_src.sh b/test/git/install_git_from_src.sh
index 4bdcf30..c355224 100644
--- a/test/git/install_git_from_src.sh
+++ b/test/git/install_git_from_src.sh
@@ -12,5 +12,13 @@ cd /tmp && git clone https://github.com/devcontainers/feature-starter.git
cd feature-starter
check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'"
+check "git-location" bash -c "which git | grep /usr/local/bin/git"
+
+check "set-git-config-user-name" bash -c "git config --system user.name devcontainers"
+check "gitconfig-file-location" bash -c "ls /etc/gitconfig"
+check "gitconfig-contains-name" bash -c "cat /etc/gitconfig | grep 'name = devcontainers'"
+
+check "usr-local-etc-config-does-not-exist" test ! -f "/usr/local/etc/gitconfig"
+
# Report result
reportResults