mirror of
https://github.com/git-for-windows/git.git
synced 2025-12-13 00:06:03 -06:00
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's not going to happen: https://github.com/git-for-windows/git/issues/4996#issuecomment-2176152565 The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses https://github.com/git-for-windows/git/issues/4996. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
41 lines
1.3 KiB
C
41 lines
1.3 KiB
C
#ifndef WIN32_PATH_UTILS_H
|
|
#define WIN32_PATH_UTILS_H
|
|
|
|
int win32_has_dos_drive_prefix(const char *path);
|
|
#define has_dos_drive_prefix win32_has_dos_drive_prefix
|
|
|
|
int win32_skip_dos_drive_prefix(char **path);
|
|
#define skip_dos_drive_prefix win32_skip_dos_drive_prefix
|
|
#define is_dir_sep is_xplatform_dir_sep
|
|
static inline char *win32_find_last_dir_sep(const char *path)
|
|
{
|
|
char *ret = NULL;
|
|
for (; *path; ++path)
|
|
if (is_dir_sep(*path))
|
|
ret = (char *)path;
|
|
return ret;
|
|
}
|
|
#define find_last_dir_sep win32_find_last_dir_sep
|
|
static inline int win32_has_dir_sep(const char *path)
|
|
{
|
|
/*
|
|
* See how long the non-separator part of the given path is, and
|
|
* if and only if it covers the whole path (i.e. path[len] is NUL),
|
|
* there is no separator in the path---otherwise there is a separator.
|
|
*/
|
|
size_t len = strcspn(path, "/\\");
|
|
return !!path[len];
|
|
}
|
|
#define has_dir_sep(path) win32_has_dir_sep(path)
|
|
int win32_offset_1st_component(const char *path);
|
|
#define offset_1st_component win32_offset_1st_component
|
|
int win32_fspathcmp(const char *a, const char *b);
|
|
#define fspathcmp win32_fspathcmp
|
|
int win32_fspathncmp(const char *a, const char *b, size_t count);
|
|
#define fspathncmp win32_fspathncmp
|
|
|
|
void win32_warn_about_git_lfs_on_windows7(int exit_code, const char *argv0);
|
|
#define warn_about_git_lfs_on_windows7 win32_warn_about_git_lfs_on_windows7
|
|
|
|
#endif
|