From: Johannes Schindelin Date: Sat, 11 Mar 2023 16:54:13 +0000 (+0100) Subject: Sync with 2.30.9 X-Git-Tag: v2.31.8~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b524e896b64f90086d913eebccaff3cd76f96dee;p=thirdparty%2Fgit.git Sync with 2.30.9 * 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 ... --- b524e896b64f90086d913eebccaff3cd76f96dee diff --cc gettext.h index c8b34fd612,b96ab9d340..5b42e458e5 --- a/gettext.h +++ b/gettext.h @@@ -28,12 -28,17 +28,14 @@@ #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 t/t0033-safe-directory.sh index 239d93f4d2,00c6c51100..22ae88398c --- a/t/t0033-safe-directory.sh +++ b/t/t0033-safe-directory.sh @@@ -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' ' diff --cc t/t1300-config.sh index e0dd5d65ce,de564cb8e5..a4db7e1b45 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@@ -616,6 -613,36 +616,36 @@@ test_expect_success 'renaming to bogus test_must_fail git config --rename-section branch.zwei "bogus name" ' + 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 && - test_i18ngrep "refusing to work with overly long line in .y. on line 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