Skip to content

Commit 92018ae

Browse files
committed
Merge pull request #3751 from rkitover/native-term
mingw: set $env:TERM=xterm-256color for newer OSes
2 parents 63f79b0 + f8248ab commit 92018ae

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

builtin/bisect.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,8 @@ int cmd_bisect(int argc, const char **argv, const char *prefix)
12571257

12581258
git_config(git_default_config, NULL);
12591259

1260+
git_config(git_default_config, NULL);
1261+
12601262
argc -= 2;
12611263
argv += 2;
12621264

builtin/update-index.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,17 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
11821182
the_index.version = preferred_index_format;
11831183
}
11841184

1185+
/*
1186+
* It is possible, though unlikely, that a caller could use the verbose
1187+
* output to synchronize with addition of objects to the object
1188+
* database. The current implementation of ODB transactions leaves
1189+
* objects invisible while a transaction is active, so end the
1190+
* transaction here if verbose output is enabled.
1191+
*/
1192+
1193+
if (verbose)
1194+
end_odb_transaction();
1195+
11851196
if (read_from_stdin) {
11861197
struct strbuf buf = STRBUF_INIT;
11871198
struct strbuf unquoted = STRBUF_INIT;

ci/run-test-slice.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ handle_failed_tests
1818
# Run the git subtree tests only if main tests succeeded
1919
test 0 != "$1" || make -C contrib/subtree test
2020

21+
# Run the git subtree tests only if main tests succeeded
22+
test 0 != "$1" || make -C contrib/subtree test
23+
2124
check_unignored_build_artifacts

compat/mingw.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,9 +3378,20 @@ static void setup_windows_environment(void)
33783378
convert_slashes(tmp);
33793379
}
33803380

3381-
/* simulate TERM to enable auto-color (see color.c) */
3382-
if (!getenv("TERM"))
3383-
setenv("TERM", "cygwin", 1);
3381+
3382+
/*
3383+
* Make sure TERM is set up correctly to enable auto-color
3384+
* (see color.c .) Use "cygwin" for older OS releases which
3385+
* works correctly with MSYS2 utilities on older consoles.
3386+
*/
3387+
if (!getenv("TERM")) {
3388+
if ((GetVersion() >> 16) < 15063)
3389+
setenv("TERM", "cygwin", 0);
3390+
else {
3391+
setenv("TERM", "xterm-256color", 0);
3392+
setenv("COLORTERM", "truecolor", 0);
3393+
}
3394+
}
33843395

33853396
/* calculate HOME if not set */
33863397
if (!getenv("HOME")) {

fsmonitor-settings.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ void fsm_settings__set_ipc(struct repository *r)
157157
if (!r->settings.fsmonitor)
158158
r->settings.fsmonitor = alloc_settings();
159159

160+
if (check_for_incompatible(r))
161+
return;
162+
160163
r->settings.fsmonitor->mode = FSMONITOR_MODE_IPC;
161164
r->settings.fsmonitor->reason = reason;
162165
FREE_AND_NULL(r->settings.fsmonitor->hook_path);
@@ -180,6 +183,9 @@ void fsm_settings__set_hook(struct repository *r, const char *path)
180183
if (!r->settings.fsmonitor)
181184
r->settings.fsmonitor = alloc_settings();
182185

186+
if (check_for_incompatible(r))
187+
return;
188+
183189
r->settings.fsmonitor->mode = FSMONITOR_MODE_HOOK;
184190
r->settings.fsmonitor->reason = reason;
185191
FREE_AND_NULL(r->settings.fsmonitor->hook_path);

0 commit comments

Comments
 (0)