diff options
author | David Michael <fedora.dm0@gmail.com> | 2014-12-04 03:24:17 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-12-04 20:58:36 +0100 |
commit | d543d9c0f44a89f30ec1670f16c698b5da801476 (patch) | |
tree | a4b23afa1f7297104e9a56ff13c78f467d668eb9 /cache.h | |
parent | Merge branch 'nd/gitignore-trailing-whitespace' into maint (diff) | |
download | git-d543d9c0f44a89f30ec1670f16c698b5da801476.tar.xz git-d543d9c0f44a89f30ec1670f16c698b5da801476.zip |
compat: convert modes to use portable file type values
This adds simple wrapper functions around calls to stat(), fstat(),
and lstat() that translate the operating system's native file type
bits to those used by most operating systems. It also rewrites the
S_IF* macros to the common values, so all file type processing is
performed using the translated modes. This makes projects portable
across operating systems that use different file type definitions.
Only the file type bits may be affected by these compatibility
functions; the file permission bits are assumed to be 07777 and are
passed through unchanged.
Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -64,13 +64,6 @@ unsigned long git_deflate_bound(git_zstream *, unsigned long); * * The value 0160000 is not normally a valid mode, and * also just happens to be S_IFDIR + S_IFLNK - * - * NOTE! We *really* shouldn't depend on the S_IFxxx macros - * always having the same values everywhere. We should use - * our internal git values for these things, and then we can - * translate that to the OS-specific value. It just so - * happens that everybody shares the same bit representation - * in the UNIX world (and apparently wider too..) */ #define S_IFGITLINK 0160000 #define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK) |