summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorDavid Michael <fedora.dm0@gmail.com>2014-12-04 02:24:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-04 19:58:36 (GMT)
commitd543d9c0f44a89f30ec1670f16c698b5da801476 (patch)
treea4b23afa1f7297104e9a56ff13c78f467d668eb9 /cache.h
parent7fa1365c54c28b3cd9375539f381b54061a1880d (diff)
downloadgit-d543d9c0f44a89f30ec1670f16c698b5da801476.zip
git-d543d9c0f44a89f30ec1670f16c698b5da801476.tar.gz
git-d543d9c0f44a89f30ec1670f16c698b5da801476.tar.bz2
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.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/cache.h b/cache.h
index dcf3a2a..a2911fa 100644
--- a/cache.h
+++ b/cache.h
@@ -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)