]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'maint-2.36' into maint-2.37
authorJunio C Hamano <gitster@pobox.com>
Tue, 13 Dec 2022 12:20:35 +0000 (21:20 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Dec 2022 12:20:35 +0000 (21:20 +0900)
1  2 
fsck.c
fsck.h
git-compat-util.h
t/t1450-fsck.sh

diff --cc fsck.c
Simple merge
diff --cc fsck.h
index 6f801e53b1d70ea9e522babbb119b913a7b32b62,cc3379d4e93c315b99efad89b595467abbea0bfe..121b8319852da6824a8d905c22911ca1c65436d5
--- 1/fsck.h
--- 2/fsck.h
+++ b/fsck.h
@@@ -55,7 -55,12 +55,11 @@@ enum fsck_msg_type 
        FUNC(GITMODULES_URL, ERROR) \
        FUNC(GITMODULES_PATH, ERROR) \
        FUNC(GITMODULES_UPDATE, ERROR) \
+       FUNC(GITATTRIBUTES_MISSING, ERROR) \
+       FUNC(GITATTRIBUTES_LARGE, ERROR) \
+       FUNC(GITATTRIBUTES_LINE_LENGTH, ERROR) \
+       FUNC(GITATTRIBUTES_BLOB, ERROR) \
        /* warnings */ \
 -      FUNC(BAD_FILEMODE, WARN) \
        FUNC(EMPTY_NAME, WARN) \
        FUNC(FULL_PATHNAME, WARN) \
        FUNC(HAS_DOT, WARN) \
index 6aee4d92e710f694dc43d34568073d343b6fbe60,33636827d5da453c4c6282a18e3fa4c8aba227ec..fdb24fcd2f357c28626502d0c776c20f32e82e65
@@@ -998,28 -989,14 +998,36 @@@ static inline unsigned long cast_size_t
        return (unsigned long)a;
  }
  
+ static inline int cast_size_t_to_int(size_t a)
+ {
+       if (a > INT_MAX)
+               die("number too large to represent as int on this platform: %"PRIuMAX,
+                   (uintmax_t)a);
+       return (int)a;
+ }
 +/*
 + * Limit size of IO chunks, because huge chunks only cause pain.  OS X
 + * 64-bit is buggy, returning EINVAL if len >= INT_MAX; and even in
 + * the absence of bugs, large chunks can result in bad latencies when
 + * you decide to kill the process.
 + *
 + * We pick 8 MiB as our default, but if the platform defines SSIZE_MAX
 + * that is smaller than that, clip it to SSIZE_MAX, as a call to
 + * read(2) or write(2) larger than that is allowed to fail.  As the last
 + * resort, we allow a port to pass via CFLAGS e.g. "-DMAX_IO_SIZE=value"
 + * to override this, if the definition of SSIZE_MAX given by the platform
 + * is broken.
 + */
 +#ifndef MAX_IO_SIZE
 +# define MAX_IO_SIZE_DEFAULT (8*1024*1024)
 +# if defined(SSIZE_MAX) && (SSIZE_MAX < MAX_IO_SIZE_DEFAULT)
 +#  define MAX_IO_SIZE SSIZE_MAX
 +# else
 +#  define MAX_IO_SIZE MAX_IO_SIZE_DEFAULT
 +# endif
 +#endif
 +
  #ifdef HAVE_ALLOCA_H
  # include <alloca.h>
  # define xalloca(size)      (alloca(size))
diff --cc t/t1450-fsck.sh
Simple merge