Skip to content

Commit

Permalink
Redefine PATH_MAX to allow all Git operations to take advantage of Wi…
Browse files Browse the repository at this point in the history
…ndows long path support.

Signed-off-by: Lucas Zadrozny <[email protected]>
  • Loading branch information
lucasz93 committed Mar 4, 2024
1 parent ad0bbff commit 936f5d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,19 @@ char *gitdirname(char *);
#define PATH_MAX 4096
#endif

/* PATH_MAX is inherited from mingw64/include/limits.h, with a value of 260.
* The problem is that even after enabling Windows long path support and
* 'core.longpaths' there are still some Git operations that will fail, such
* as cloning a submodule (see setup_explicit_git_dir).
*
* I've observed some CI runners that have temp clones in a deeply nested
* path which will break even some medium sized repository paths.
*
* Redefining this macro addresses that issue.
*/
#undef PATH_MAX
#define PATH_MAX MAX_LONG_PATH

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

git-compat-util.h:451:18: 'MAX_LONG_PATH' undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

git-compat-util.h:451:18: 'MAX_LONG_PATH' undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

git-compat-util.h:451:18: 'MAX_LONG_PATH' undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function); did you mean ‘MAX_INPUT’?

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function); did you mean ‘MAX_INPUT’?

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function); did you mean ‘MAX_INPUT’?

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux32 (daald/ubuntu32:xenial)

git-compat-util.h:451:18: 'MAX_LONG_PATH' undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function); did you mean ‘MAX_INPUT’?

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function); did you mean ‘MAX_INPUT’?

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function); did you mean ‘MAX_INPUT’?

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

git-compat-util.h:451:18: ‘MAX_LONG_PATH’ undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

git-compat-util.h:451:18: 'MAX_LONG_PATH' undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

git-compat-util.h:451:18: 'MAX_LONG_PATH' undeclared (first use in this function)

Check failure on line 451 in git-compat-util.h

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

git-compat-util.h:451:18: 'MAX_LONG_PATH' undeclared (first use in this function)

#ifndef NAME_MAX
#define NAME_MAX 255
#endif
Expand Down

0 comments on commit 936f5d0

Please sign in to comment.