Skip to content

Commit

Permalink
Merge pull request microsoft#444 from vdye/reset-upstream-changes
Browse files Browse the repository at this point in the history
Sparse Index: upstream updates to `git reset`
  • Loading branch information
vdye authored and ldennington committed Jan 12, 2022
2 parents af911b3 + 2838ab6 commit 62f3680
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
22 changes: 2 additions & 20 deletions builtin/update-microsoft-git.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,8 @@ static int platform_specific_upgrade(void)
#else
static int platform_specific_upgrade(void)
{
int res;
struct strvec args = STRVEC_INIT;

printf("Updating apt-get with 'sudo apt-get update'\n\n");

strvec_pushl(&args, "sudo", "apt-get", "update", NULL);
res = run_command_v_opt(args.v, 0);
strvec_clear(&args);

if (res) {
error(_("'sudo apt-get update' failed; is apt-get installed?"));
return 1;
}

printf("\nUpgrading microsoft-git with 'sudo apt-get upgrade microsoft-git'\n\n");
strvec_pushl(&args, "sudo", "apt-get", "upgrade", "microsoft-git", NULL);
res = run_command_v_opt(args.v, 0);
strvec_clear(&args);

return res;
error(_("update-microsoft-git is not supported on this platform"));
return 1;
}
#endif

Expand Down
3 changes: 2 additions & 1 deletion read-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,8 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist)
* settings and other properties of the index (if necessary).
*/
prepare_repo_settings(istate->repo);
if (istate->repo->settings.command_requires_full_index)
if (!istate->repo->settings.sparse_index ||
istate->repo->settings.command_requires_full_index)
ensure_full_index(istate);
else
ensure_correct_sparsity(istate);
Expand Down

0 comments on commit 62f3680

Please sign in to comment.