Add an option not to use link(src, dest) && unlink(src) when that is unreliable
[gitweb.git] / Makefile
index 6f602c7bbfa2fe21fe86f88d26d1fdb00b5b6296..5c8e83a99732626fd47fb4a9f97e08d93f90ffb1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -171,6 +171,10 @@ all::
 # Define UNRELIABLE_FSTAT if your system's fstat does not return the same
 # information on a not yet closed file that lstat would return for the same
 # file after it was closed.
+#
+# Define UNRELIABLE_HARDLINKS if your operating systems has problems when
+# hardlinking a file to another name and unlinking the original file right
+# away (some NTFS drivers seem to zero the contents in that scenario).
 
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -835,6 +839,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
        NO_NSEC = YesPlease
        USE_WIN32_MMAP = YesPlease
        UNRELIABLE_FSTAT = UnfortunatelyYes
+       UNRELIABLE_HARDLINKS = UnfortunatelySometimes
        COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch
        COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
        COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
@@ -1018,6 +1023,9 @@ else
                COMPAT_OBJS += compat/win32mmap.o
        endif
 endif
+ifdef UNRELIABLE_HARDLINKS
+       COMPAT_CFLAGS += -DUNRELIABLE_HARDLINKS=1
+endif
 ifdef NO_PREAD
        COMPAT_CFLAGS += -DNO_PREAD
        COMPAT_OBJS += compat/pread.o