diff --git a/compat/win32/path-utils.c b/compat/win32/path-utils.c index 158380b7fc6267..012d95e668b59b 100644 --- a/compat/win32/path-utils.c +++ b/compat/win32/path-utils.c @@ -222,13 +222,17 @@ void win32_warn_about_git_lfs_on_windows7(int exit_code, const char *argv0) * would usually show up as an exit code 0xc0000005. For some reason * (probably because at this point, we no longer have the _original_ * HANDLE that was returned by `CreateProcess()`) we get 0xb00 instead. + * When running in Git Bash we get exit code 2, so we check for that + * as well. */ - if (exit_code != 0x0b00) + if (exit_code != 0x0002 && exit_code != 0x0b00) return; if (GetVersion() >> 16 > 7601) return; /* Warn only on Windows 7 or older */ - if (!starts_with(argv0, "git-lfs ") || - !(git_lfs = locate_in_PATH("git-lfs"))) + if (!istarts_with(argv0, "git-lfs ") && + strcasecmp(argv0, "git-lfs")) + return; + if (!(git_lfs = locate_in_PATH("git-lfs"))) return; if (get_go_version(git_lfs, buffer, sizeof(buffer)) > 0 && skip_prefix(buffer, "go", &p) &&