Skip to content

Commit

Permalink
update-microsoft-git: Windows implementation
Browse files Browse the repository at this point in the history
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 <dstolee@microsoft.com>
  • Loading branch information
derrickstolee authored and dscho committed Sep 22, 2022
1 parent fe81670 commit 213cda7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions builtin/update-microsoft-git.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,31 @@
#include "repository.h"
#include "parse-options.h"
#include "run-command.h"
#include "strvec.h"

#if defined(GIT_WINDOWS_NATIVE)
/*
* On Windows, run 'git update-git-for-windows' which
* is installed by the installer, based on the script
* in git-for-windows/build-extra.
*/
static int platform_specific_upgrade(void)
{
int res;
struct strvec args = STRVEC_INIT;

strvec_push(&args, "git-update-git-for-windows");
res = run_command_v_opt(args.v, 0);
strvec_clear(&args);
return res;
}
#else
static int platform_specific_upgrade(void)
{
error(_("update-microsoft-git is not supported on this platform"));
return 1;
}
#endif

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

0 comments on commit 213cda7

Please sign in to comment.