From 4bc937313fff861658d899557fe03242d6f430cb Mon Sep 17 00:00:00 2001
From: Sergio Padrino <sergio.padrino@gmail.com>
Date: Tue, 21 Jan 2025 17:05:49 +0100
Subject: [PATCH 1/9] Bump dugite-native to v2.47.1

---
 script/embedded-git.json | 48 ++++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/script/embedded-git.json b/script/embedded-git.json
index 2dc0258..6cadaa2 100644
--- a/script/embedded-git.json
+++ b/script/embedded-git.json
@@ -1,42 +1,42 @@
 {
   "win32-x64": {
-    "name": "dugite-native-v2.45.3-249d956-windows-x64.tar.gz",
-    "url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-windows-x64.tar.gz",
-    "checksum": "c673e4afba7541767ae2421c40d0dda9e0af6d58c02dea28207627d4dff05fb3"
+    "name": "dugite-native-v2.47.1-8d348e6-windows-x64.tar.gz",
+    "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-windows-x64.tar.gz",
+    "checksum": "bca0fb95b136ec4227452ee603eb5b8bf5213f9a8c99b72a617db654046c17c7"
   },
   "win32-ia32": {
-    "name": "dugite-native-v2.45.3-249d956-windows-x86.tar.gz",
-    "url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-windows-x86.tar.gz",
-    "checksum": "26c129ad566ea27100e4d724badb40ee6becedf21db229c96553f4b835367056"
+    "name": "dugite-native-v2.47.1-8d348e6-windows-x86.tar.gz",
+    "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-windows-x86.tar.gz",
+    "checksum": "f938bc2ef0ae702479b53bb0838b5cfeea14d35c4215757e1a6df95dea52cad4"
   },
   "darwin-x64": {
-    "name": "dugite-native-v2.45.3-249d956-macOS-x64.tar.gz",
-    "url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-macOS-x64.tar.gz",
-    "checksum": "f8191f31248200866172ef7be6e8c97d724278c90a4c021c71362bde47a3ee2a"
+    "name": "dugite-native-v2.47.1-8d348e6-macOS-x64.tar.gz",
+    "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-macOS-x64.tar.gz",
+    "checksum": "475040cf643a3962d557aad9b91e861eace6d6bb28c01bb54535544c43e19459"
   },
   "darwin-arm64": {
-    "name": "dugite-native-v2.45.3-249d956-macOS-arm64.tar.gz",
-    "url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-macOS-arm64.tar.gz",
-    "checksum": "b24aa30a56cc352159e1c842f1d248009e61f1b9e594dd34f09809dc792cf90f"
+    "name": "dugite-native-v2.47.1-8d348e6-macOS-arm64.tar.gz",
+    "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-macOS-arm64.tar.gz",
+    "checksum": "451dc41889a4deef06e2d3495364f74f6416bda8234b876144f5c254874b306d"
   },
   "linux-x64": {
-    "name": "dugite-native-v2.45.3-249d956-ubuntu-x64.tar.gz",
-    "url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-ubuntu-x64.tar.gz",
-    "checksum": "ca947928afd3c58b49bd686824d3b7d0b0103add6f77ccc3148f16b569db99dc"
+    "name": "dugite-native-v2.47.1-8d348e6-ubuntu-x64.tar.gz",
+    "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-ubuntu-x64.tar.gz",
+    "checksum": "0e6b3a0776e92ddef3a3fdc966d960fbf150b3f5bb74632576c0bdfbcb638042"
   },
   "linux-ia32": {
-    "name": "dugite-native-v2.45.3-249d956-ubuntu-x86.tar.gz",
-    "url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-ubuntu-x86.tar.gz",
-    "checksum": "3b4989b0656654e7c5e7bde52f8be1cd575590276c7a5d7b1acfd17af4e9e022"
+    "name": "dugite-native-v2.47.1-8d348e6-ubuntu-x86.tar.gz",
+    "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-ubuntu-x86.tar.gz",
+    "checksum": "7263bed583503808a11a5e3b5e259e63fe66e08d8c8c3934bef3bc6ca42f1e2e"
   },
   "linux-arm": {
-    "name": "dugite-native-v2.45.3-249d956-ubuntu-arm.tar.gz",
-    "url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-ubuntu-arm.tar.gz",
-    "checksum": "725398745dacb94d82b23d01f5348aebe413c924bc0b78178f2fbff517741f61"
+    "name": "dugite-native-v2.47.1-8d348e6-ubuntu-arm.tar.gz",
+    "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-ubuntu-arm.tar.gz",
+    "checksum": "a89292d44106150037932b95ddc233e09c6faf7489b44672c93d801838f496cd"
   },
   "linux-arm64": {
-    "name": "dugite-native-v2.45.3-249d956-ubuntu-arm64.tar.gz",
-    "url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-ubuntu-arm64.tar.gz",
-    "checksum": "e605f8f5d5146e8ba10be30a781639ef81de4b01e85c87d24641316c928b88ed"
+    "name": "dugite-native-v2.47.1-8d348e6-ubuntu-arm64.tar.gz",
+    "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-ubuntu-arm64.tar.gz",
+    "checksum": "b9fcc671557a86259408b31875badaedd43408c9ef1fd4d502386d2bd36923ef"
   }
 }
\ No newline at end of file

From 0928e3c8bf1e3849baaa73f0b22f61e15d529de7 Mon Sep 17 00:00:00 2001
From: Sergio Padrino <sergio.padrino@gmail.com>
Date: Tue, 21 Jan 2025 17:07:59 +0100
Subject: [PATCH 2/9] Update git versions in tests

---
 test/helpers.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/helpers.ts b/test/helpers.ts
index 9790454..93f6c2e 100644
--- a/test/helpers.ts
+++ b/test/helpers.ts
@@ -6,8 +6,8 @@ import { join } from 'path'
 import { tmpdir } from 'os'
 
 // NOTE: bump these versions to the latest stable releases
-export const gitVersion = '2.45.3'
-export const gitForWindowsVersion = '2.45.2.windows.2'
+export const gitVersion = '2.47.1'
+export const gitForWindowsVersion = '2.47.1.windows.2'
 export const gitLfsVersion = '3.6.1'
 export const gitCredentialManagerVersion = '2.6.1'
 

From 7e798b1cd60045c75a0ee00fe9ba579dc17c7389 Mon Sep 17 00:00:00 2001
From: Sergio Padrino <sergio.padrino@gmail.com>
Date: Tue, 21 Jan 2025 17:08:49 +0100
Subject: [PATCH 3/9] 3.0.0-rc7

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index b315cd7..704e867 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "dugite",
-  "version": "3.0.0-rc6",
+  "version": "3.0.0-rc7",
   "description": "Elegant bindings for Git",
   "main": "./build/lib/index.js",
   "typings": "./build/lib/index.d.ts",

From 151ff14a25b6872af99a62094013202ead12a01a Mon Sep 17 00:00:00 2001
From: Sergio Padrino <sergio.padrino@gmail.com>
Date: Tue, 21 Jan 2025 17:28:58 +0100
Subject: [PATCH 4/9] Make sure arm64 dugite-native binaries are used on
 Windows too

---
 script/config.js | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/script/config.js b/script/config.js
index 6f0b691..ec5c75f 100644
--- a/script/config.js
+++ b/script/config.js
@@ -23,12 +23,6 @@ function getConfig() {
     arch = process.env.npm_config_arch
   }
 
-  if (process.platform === 'win32' && arch === 'arm64') {
-    // Use the Dugite Native ia32 package for Windows arm64 (arm64 can run 32-bit code through emulation)
-    console.log('Downloading 32-bit Dugite Native for Windows arm64')
-    arch = 'ia32'
-  }
-
   const key = `${process.platform}-${arch}`
 
   const entry = embeddedGit[key]

From 53a6812a3600b359f8ff9679c79347db3034be75 Mon Sep 17 00:00:00 2001
From: Sergio Padrino <sergio.padrino@gmail.com>
Date: Tue, 21 Jan 2025 17:29:35 +0100
Subject: [PATCH 5/9] 3.0.0-rc8

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 704e867..8cff76b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "dugite",
-  "version": "3.0.0-rc7",
+  "version": "3.0.0-rc8",
   "description": "Elegant bindings for Git",
   "main": "./build/lib/index.js",
   "typings": "./build/lib/index.d.ts",

From 667ec954eb8ba39c68ef3f6c3c14c09a70edf6d1 Mon Sep 17 00:00:00 2001
From: Sergio Padrino <sergio.padrino@gmail.com>
Date: Tue, 21 Jan 2025 17:34:13 +0100
Subject: [PATCH 6/9] Look for windows-arm64 binaries too :facepalm:

---
 script/embedded-git.json      |  5 +++++
 script/update-embedded-git.js | 11 ++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/script/embedded-git.json b/script/embedded-git.json
index 6cadaa2..ce48f03 100644
--- a/script/embedded-git.json
+++ b/script/embedded-git.json
@@ -9,6 +9,11 @@
     "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-windows-x86.tar.gz",
     "checksum": "f938bc2ef0ae702479b53bb0838b5cfeea14d35c4215757e1a6df95dea52cad4"
   },
+  "win32-arm64": {
+    "name": "dugite-native-v2.47.1-8d348e6-windows-arm64.tar.gz",
+    "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-windows-arm64.tar.gz",
+    "checksum": "4a3f4d77f3fec67b1c3235a6a82c3e259eb8eb4babd868da5a3e5d5ac309c590"
+  },
   "darwin-x64": {
     "name": "dugite-native-v2.47.1-8d348e6-macOS-x64.tar.gz",
     "url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-macOS-x64.tar.gz",
diff --git a/script/update-embedded-git.js b/script/update-embedded-git.js
index 9469c3c..3c74a19 100644
--- a/script/update-embedded-git.js
+++ b/script/update-embedded-git.js
@@ -12,6 +12,7 @@ fetch(`https://api.github.com/repos/desktop/dugite-native/releases/latest`)
       const output = {
         'win32-x64': await findWindows64BitRelease(assets),
         'win32-ia32': await findWindows32BitRelease(assets),
+        'win32-arm64': await findWindowsARM64BitRelease(assets),
         'darwin-x64': await findMacOSx64BitRelease(assets),
         'darwin-arm64': await findMacOSARM64BitRelease(assets),
         'linux-x64': await findLinux64BitRelease(assets),
@@ -54,6 +55,14 @@ function findWindows32BitRelease(assets) {
   return getDetailsForAsset(assets, asset)
 }
 
+function findWindowsARM64BitRelease(assets) {
+  const asset = assets.find(a => a.name.endsWith('-windows-arm64.tar.gz'))
+  if (asset == null) {
+    throw new Error('Could not find Windows arm64 archive in latest release')
+  }
+  return getDetailsForAsset(assets, asset)
+}
+
 function findMacOSx64BitRelease(assets) {
   const asset = assets.find(a => a.name.endsWith('-macOS-x64.tar.gz'))
   if (asset == null) {
@@ -65,7 +74,7 @@ function findMacOSx64BitRelease(assets) {
 function findMacOSARM64BitRelease(assets) {
   const asset = assets.find(a => a.name.endsWith('-macOS-arm64.tar.gz'))
   if (asset == null) {
-    throw new Error('Could not find MacOS 64-bit archive in latest release')
+    throw new Error('Could not find MacOS arm64 archive in latest release')
   }
   return getDetailsForAsset(assets, asset)
 }

From b5734089bd4c98e418214852f9f58bd7239f04ca Mon Sep 17 00:00:00 2001
From: Sergio Padrino <sergio.padrino@gmail.com>
Date: Tue, 21 Jan 2025 17:34:19 +0100
Subject: [PATCH 7/9] 3.0.0-rc9

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 8cff76b..19c7d79 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "dugite",
-  "version": "3.0.0-rc8",
+  "version": "3.0.0-rc9",
   "description": "Elegant bindings for Git",
   "main": "./build/lib/index.js",
   "typings": "./build/lib/index.d.ts",

From 6819919a3d34a2cbe00570ccc8f6d49b2183a1fb Mon Sep 17 00:00:00 2001
From: Sergio Padrino <sergio.padrino@gmail.com>
Date: Tue, 21 Jan 2025 17:47:40 +0100
Subject: [PATCH 8/9] Look for git executables in the right place

---
 lib/git-environment.ts | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lib/git-environment.ts b/lib/git-environment.ts
index 0c7012a..a9fc960 100644
--- a/lib/git-environment.ts
+++ b/lib/git-environment.ts
@@ -1,6 +1,16 @@
 import * as path from 'path'
 import { EnvMap } from './env-map'
 
+function getWin32GitSubfolder(): string {
+  if (process.arch === 'x64') {
+    return 'mingw64'
+  } else if (process.arch === 'arm64') {
+    return 'clangarm64'
+  } else {
+    return 'mingw32'
+  }
+}
+
 export function resolveEmbeddedGitDir(): string {
   if (
     process.platform === 'darwin' ||
@@ -57,8 +67,7 @@ export function resolveGitExecPath(
   }
   const gitDir = resolveGitDir(localGitDir)
   if (process.platform === 'win32') {
-    const mingw = process.arch === 'x64' ? 'mingw64' : 'mingw32'
-    return path.join(gitDir, mingw, 'libexec', 'git-core')
+    return path.join(gitDir, getWin32GitSubfolder(), 'libexec', 'git-core')
   } else {
     return path.join(gitDir, 'libexec', 'git-core')
   }
@@ -89,10 +98,9 @@ export function setupEnvironment(
   const gitDir = resolveGitDir(localGitDir)
 
   if (process.platform === 'win32') {
-    const mingw = process.arch === 'x64' ? 'mingw64' : 'mingw32'
     env.set(
       'PATH',
-      `${gitDir}\\${mingw}\\bin;${gitDir}\\${mingw}\\usr\\bin;${
+      `${gitDir}\\${getWin32GitSubfolder()}\\bin;${gitDir}\\${getWin32GitSubfolder()}\\usr\\bin;${
         env.get('PATH') ?? ''
       }`
     )

From 44274ca1f573a486aa6b263a481b8a5031f039fd Mon Sep 17 00:00:00 2001
From: Sergio Padrino <sergio.padrino@gmail.com>
Date: Tue, 21 Jan 2025 17:48:17 +0100
Subject: [PATCH 9/9] 3.0.0-rc10

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 19c7d79..b21bb21 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "dugite",
-  "version": "3.0.0-rc9",
+  "version": "3.0.0-rc10",
   "description": "Elegant bindings for Git",
   "main": "./build/lib/index.js",
   "typings": "./build/lib/index.d.ts",