Skip to content

Commit 4fe06db

Browse files
dschoderrickstolee
authored andcommitted
Merge pull request #243 from dscho/disable-update-gfw
Disable `git update-git-for-windows`
2 parents f3919b5 + b678529 commit 4fe06db

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

builtin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix);
236236
int cmd_tar_tree(int argc, const char **argv, const char *prefix);
237237
int cmd_unpack_file(int argc, const char **argv, const char *prefix);
238238
int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
239+
int cmd_update(int argc, const char **argv, const char *prefix);
239240
int cmd_update_index(int argc, const char **argv, const char *prefix);
240241
int cmd_update_ref(int argc, const char **argv, const char *prefix);
241242
int cmd_update_server_info(int argc, const char **argv, const char *prefix);

git.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,8 @@ static struct cmd_struct commands[] = {
657657
{ "tag", cmd_tag, RUN_SETUP | DELAY_PAGER_CONFIG },
658658
{ "unpack-file", cmd_unpack_file, RUN_SETUP | NO_PARSEOPT },
659659
{ "unpack-objects", cmd_unpack_objects, RUN_SETUP | NO_PARSEOPT },
660+
{ "update", cmd_update },
661+
{ "update-git-for-windows", cmd_update },
660662
{ "update-index", cmd_update_index, RUN_SETUP },
661663
{ "update-ref", cmd_update_ref, RUN_SETUP },
662664
{ "update-server-info", cmd_update_server_info, RUN_SETUP },

help.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,3 +794,19 @@ NORETURN void help_unknown_ref(const char *ref, const char *cmd,
794794
string_list_clear(&suggested_refs, 0);
795795
exit(1);
796796
}
797+
798+
int cmd_update(int argc, const char **argv, const char *prefix)
799+
{
800+
const char * const usage[] = {
801+
N_("git update-git-for-windows [<options>]\n"
802+
"\t(not supported in this build of Git for Windows)"),
803+
NULL
804+
};
805+
struct option options[] = {
806+
OPT_END()
807+
};
808+
809+
argc = parse_options(argc, argv, prefix, options, usage, 0);
810+
811+
die(_("git %s is not supported in VFSforGit"), argv[0]);
812+
}

t/t0402-block-command-on-gvfs.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,11 @@ test_expect_success 'test gc --auto succeeds when disabled via config' '
3636
git gc --auto
3737
'
3838

39+
test_expect_success 'update-git-for-windows disabled' '
40+
test_must_fail git update 2>out &&
41+
test_i18ngrep VFS out &&
42+
test_must_fail git update-git-for-windows 2>out &&
43+
test_i18ngrep VFS out
44+
'
45+
3946
test_done

0 commit comments

Comments
 (0)