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 Apr 29, 2024
1 parent 586cda0 commit 3a3c47b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions builtin/update-microsoft-git.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,28 @@
#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)
{
struct child_process cp = CHILD_PROCESS_INIT;

strvec_push(&cp.args, "git-update-git-for-windows");
return run_command(&cp);
}
#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 3a3c47b

Please sign in to comment.