mirror of
https://github.com/git/git.git
synced 2025-09-10 22:44:50 +02:00
Encoding submodule names increases their name size, so there is an increased risk to hit the max filename length in the gitdir path. (the likelihood is still rather small, so it's an acceptable risk) This gitdir file-name-too-long corner case can be be addressed in multiple ways, including sharding or trimming, however for now, just add the portable logic (suggested by Peff) to detect the corner case then error out to avoid comitting to a specific policy (or policies). In the future, instead of throwing an error (which we do now anyway without submodule encoding), we could maybe let the user specify via configs how to address this case, eg pick trimming or sharding. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 lines
239 B
C
11 lines
239 B
C
#include "git-compat-util.h"
|
|
|
|
/*
|
|
* Minimal stub for platforms without pathconf() (e.g. Windows),
|
|
* to fall back to NAME_MAX from limits.h or compat/posix.h.
|
|
*/
|
|
long git_pathconf(const char *path UNUSED, int name UNUSED)
|
|
{
|
|
return -1;
|
|
}
|