git_path_is_gitfile

Check whether a path component corresponds to a .git$SUFFIX file.

As some filesystems do special things to filenames when writing files to disk, you cannot always do a plain string comparison to verify whether a file name matches an expected path or not. This function can do the comparison for you, depending on the filesystem you're on.

package extern (C) nothrow @nogc
int
git_path_is_gitfile

Parameters

path const(char)*

the path component to check

pathlen size_t

the length of path that is to be checked

gitfile .git_path_gitfile

which file to check against

fs .git_path_fs

which filesystem-specific checks to use

Return Value

Type: int

0 in case the file does not match, a positive value if it does; -1 in case of an error

Meta