Skip to content

Commit 91bfb37

Browse files
dennisamelingdscho
authored andcommitted
git update-git-for-windows: download ARM64 Git for Windows if applicable
If the /arm64/bin folder is present, we assume that the user has the ARM64 version of Git for Windows installed. When a new version is available, we'll then automatically download the ARM64 version. This is similar to the logic in git-wrapper.c in mingw-w64-git (technically, the Git wrapper _also_ tests whether it is running an ARM64 executable, but we cannot do that in a shell script). Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a7033b6 commit 91bfb37

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

git-extra/git-update-git-for-windows

+9-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,14 @@ update_git_for_windows () {
215215
test -n "$quiet" && test "x$recently_seen" = "x$latest" && return
216216

217217
version=$(git --version | sed "s/git version //")
218-
echo "$git_label $version (${bit}bit)" >&2
218+
if test -d /arm64/bin
219+
then
220+
arch_bit=ARM64
221+
else
222+
arch_bit=${bit}-bit
223+
fi
224+
225+
echo "$git_label $version ($arch_bit)" >&2
219226
if test -z "$testing" && test "$latest" = "$version"
220227
then
221228
echo "Up to date" >&2
@@ -237,7 +244,7 @@ update_git_for_windows () {
237244
releases=$(http_get $releases_url/latest) || return
238245
download=$(echo "$releases" |
239246
grep '"browser_download_url": "' |
240-
grep "$bit\-bit\.exe" |
247+
grep "$arch_bit\.exe" |
241248
sed -E 's/.*": "([^"]*).*/\1/')
242249
filename=$(echo "$download" | sed -E 's/.*\/([^\/]*)$/\1/')
243250
name="$(echo "$releases" | sed -n 's/^ "name": "\(.*\)",$/\1/p')"

0 commit comments

Comments
 (0)