]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Sync with 2.30.9
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 11 Mar 2023 16:54:13 +0000 (17:54 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 17 Apr 2023 19:15:44 +0000 (21:15 +0200)
* maint-2.30: (23 commits)
  Git 2.30.9
  gettext: avoid using gettext if the locale dir is not present
  apply --reject: overwrite existing `.rej` symlink if it exists
  http.c: clear the 'finished' member once we are done with it
  clone.c: avoid "exceeds maximum object size" error with GCC v12.x
  range-diff: use ssize_t for parsed "len" in read_patches()
  range-diff: handle unterminated lines in read_patches()
  range-diff: drop useless "offset" variable from read_patches()
  t5604: GETTEXT_POISON fix, conclusion
  t5604: GETTEXT_POISON fix, part 1
  t5619: GETTEXT_POISON fix
  t0003: GETTEXT_POISON fix, conclusion
  t0003: GETTEXT_POISON fix, part 1
  t0033: GETTEXT_POISON fix
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  ci: install python on ubuntu
  ci: use the same version of p4 on both Linux and macOS
  ci: remove the pipe after "p4 -V" to catch errors
  github-actions: run gcc-8 on ubuntu-20.04 image
  ...

14 files changed:
1  2 
.github/workflows/main.yml
apply.c
builtin/clone.c
ci/install-dependencies.sh
ci/lib.sh
config.c
gettext.c
gettext.h
http-push.c
http.c
http.h
range-diff.c
t/t0033-safe-directory.sh
t/t1300-config.sh

Simple merge
diff --cc apply.c
Simple merge
diff --cc builtin/clone.c
Simple merge
Simple merge
diff --cc ci/lib.sh
Simple merge
diff --cc config.c
Simple merge
diff --cc gettext.c
Simple merge
diff --cc gettext.h
index c8b34fd61229e39fc99fd29a2135de86c2b6dac3,b96ab9d3403481b2c585db0a259f24b15724590a..5b42e458e5b9807857344bb92d45ecda6ddaa520
+++ b/gettext.h
  
  #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
  
 -int use_gettext_poison(void);
 -
  #ifndef NO_GETTEXT
+ extern int git_gettext_enabled;
  void git_setup_gettext(void);
  int gettext_width(const char *s);
  #else
+ #define git_gettext_enabled (0)
  static inline void git_setup_gettext(void)
  {
 -      use_gettext_poison(); /* getenv() reentrancy paranoia */
  }
  static inline int gettext_width(const char *s)
  {
@@@ -45,12 -50,17 +47,16 @@@ static inline FORMAT_PRESERVING(1) cons
  {
        if (!*msgid)
                return "";
 -      return use_gettext_poison() ? "# GETTEXT POISON #" :
 -              !git_gettext_enabled ? msgid : gettext(msgid);
++      if (!git_gettext_enabled)
++              return msgid;
 +      return gettext(msgid);
  }
  
  static inline FORMAT_PRESERVING(1) FORMAT_PRESERVING(2)
  const char *Q_(const char *msgid, const char *plu, unsigned long n)
  {
 -      if (use_gettext_poison())
 -              return "# GETTEXT POISON #";
+       if (!git_gettext_enabled)
+               return n == 1 ? msgid : plu;
        return ngettext(msgid, plu, n);
  }
  
diff --cc http-push.c
Simple merge
diff --cc http.c
Simple merge
diff --cc http.h
Simple merge
diff --cc range-diff.c
Simple merge
index 239d93f4d21141f5991f9fb409a4675ece0f98bd,00c6c5110065fa32dd73c64eec1c586685c28dd4..22ae88398c722cc59241315ac5516c3f345b7174
@@@ -9,7 -9,7 +9,7 @@@ export GIT_TEST_ASSUME_DIFFERENT_OWNE
  
  expect_rejected_dir () {
        test_must_fail git status 2>err &&
-       grep "safe.directory" err
 -      test_i18ngrep "safe.directory" err
++      grep "dubious ownership" err
  }
  
  test_expect_success 'safe.directory is not set' '
index e0dd5d65cedadbab2a5d4aa9c0697b346374612b,de564cb8e587a6cb6c17096051398a3963a5d041..a4db7e1b45d2f5f3ffeb985d842f5fcdf16732f1
@@@ -616,6 -613,36 +616,36 @@@ test_expect_success 'renaming to bogus 
        test_must_fail git config --rename-section branch.zwei "bogus name"
  '
  
 -      test_i18ngrep "refusing to work with overly long line in .y. on line 2" err
+ test_expect_success 'renaming a section with a long line' '
+       {
+               printf "[b]\\n" &&
+               printf "  c = d %1024s [a] e = f\\n" " " &&
+               printf "[a] g = h\\n"
+       } >y &&
+       git config -f y --rename-section a xyz &&
+       test_must_fail git config -f y b.e
+ '
+ test_expect_success 'renaming an embedded section with a long line' '
+       {
+               printf "[b]\\n" &&
+               printf "  c = d %1024s [a] [foo] e = f\\n" " " &&
+               printf "[a] g = h\\n"
+       } >y &&
+       git config -f y --rename-section a xyz &&
+       test_must_fail git config -f y foo.e
+ '
+ test_expect_success 'renaming a section with an overly-long line' '
+       {
+               printf "[b]\\n" &&
+               printf "  c = d %525000s e" " " &&
+               printf "[a] g = h\\n"
+       } >y &&
+       test_must_fail git config -f y --rename-section a xyz 2>err &&
++      grep "refusing to work with overly long line in .y. on line 2" err
+ '
  cat >> .git/config << EOF
    [branch "zwei"] a = 1 [branch "vier"]
  EOF