Skip to content

Commit f759434

Browse files
derrickstoleedscho
authored andcommitted
update-microsoft-git: Windows implementation
On Windows, we have the 'git update-git-for-windows' command. It is poorly named within the microsoft/git fork, because the script has been updated to look at the GitHub releases of microsoft/git, not git-for-windows/git. Still, it handles all the complicated details about downloading, verifying, and running the installer. Signed-off-by: Derrick Stolee <[email protected]>
1 parent 22f5bc6 commit f759434

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

builtin/update-microsoft-git.c

+17
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,28 @@
22
#include "repository.h"
33
#include "parse-options.h"
44
#include "run-command.h"
5+
#include "strvec.h"
56

7+
#if defined(GIT_WINDOWS_NATIVE)
8+
/*
9+
* On Windows, run 'git update-git-for-windows' which
10+
* is installed by the installer, based on the script
11+
* in git-for-windows/build-extra.
12+
*/
613
static int platform_specific_upgrade(void)
714
{
15+
struct child_process cp = CHILD_PROCESS_INIT;
16+
17+
strvec_push(&cp.args, "git-update-git-for-windows");
18+
return run_command(&cp);
19+
}
20+
#else
21+
static int platform_specific_upgrade(void)
22+
{
23+
error(_("update-microsoft-git is not supported on this platform"));
824
return 1;
925
}
26+
#endif
1027

1128
static const char builtin_update_microsoft_git_usage[] =
1229
N_("git update-microsoft-git");

0 commit comments

Comments
 (0)