aboutsummaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2026-03-19Merge branch 'ps/t9200-test-path-is-helpers'Junio C Hamano
Test update. * ps/t9200-test-path-is-helpers: t9200: replace test -f with modern path helper t9200: handle missing CVS with skip_all
2026-03-18t2107: modernize path existence checkAditya
Replace '! test -f' with 'test_path_is_missing' to get better debugging information by reporting loudly what expectation was not met when the assertion fails. Signed-off-by: Aditya <adityabnw07@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-18merge-file: fix BUG when --object-id is used in a worktreeMathias Rav
The `--object-id` option was added in commit e1068f0ad4 (merge-file: add an option to process object IDs, 2023-11-01) together with a call to setup_git_directory() to avoid crashing when run outside a repository. However, the call to setup_git_directory() is redundant when run inside a repository, as merge-file runs with RUN_SETUP_GENTLY, so the repository has already been set up. The redundant call is harmless when linked worktrees are not used, but in a linked worktree, the repo_set_gitdir() function ends up being called twice. Calling repo_set_gitdir() used to be silently accepted, but commit 2816b748e5 (odb: handle changing a repository's commondir, 2025-11-19) changed this to a BUG in repository.c with the error message: "cannot reinitialize an already-initialized object directory". Guard the redundant call to setup_git_directory() behind a repo pointer check, to ensure that we continue to give the correct "not a git repo" error whilst avoiding the BUG when running in a linked worktree. Signed-off-by: Mathias Rav <m@git.strova.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-17apply: fix new-style empty context line triggering incomplete-line checkJunio C Hamano
A new-style unified context diff represents an empty context line with an empty line (instead of a line with a single SP on it). The code to check whitespace errors in an incoming patch is designed to omit the first byte of a line (typically SP, "-", or "+") and pass the remainder of the line to the whitespace checker. Usually we do not pass a context line to the whitespace error checker, but when we are correcting errors, we do. This "remove the first byte and send the remainder" strategy of checking a line ended up sending a zero-length string to the whitespace checker when seeing a new-style empty context line, which caused the whitespace checker to say "ah, you do not even have a newline at the end!", leading to an "incomplete line" in the middle of the patch! Fix this by pretending that we got a traditional empty context line when we drive the whitespace checker. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-17apply: report input location in binary and garbage patch errorsJialong Wang
Several binary parsing paths in apply.c still report only line numbers. When more than one patch input is fed to a single invocation, that does not tell the user which input the line belongs to. Report the patch input location for corrupt and unrecognized binary patches, as well as the "patch with only garbage" case, and update the related tests. Signed-off-by: Jialong Wang <jerrywang183@yahoo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-17apply: report input location in header parsing errorsJialong Wang
Several header parsing errors in apply.c still report only line numbers. When applying more than one input, that does not tell the user which input the line belongs to. Report the patch input location for these header parsing errors, and update the related tests. While touching parse_git_diff_header(), update the helper state to use the current header line when reporting these errors. Signed-off-by: Jialong Wang <jerrywang183@yahoo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-17apply: report the location of corrupt patchesJialong Wang
When parsing a corrupt patch, git apply reports only the line number. That does not tell the user which input the line number refers to. Include the patch input path in the error message so the reported location is easier to use. Reset the line number for each patch input so the reported location stays correct when multiple input files are provided. Add tests for file input, standard input, multiple patch inputs, and existing binary-diff corrupt patch cases. Signed-off-by: Jialong Wang <jerrywang183@yahoo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-17http: add support for HTTP 429 rate limit retriesVaidas Pilkauskas
Add retry logic for HTTP 429 (Too Many Requests) responses to handle server-side rate limiting gracefully. When Git's HTTP client receives a 429 response, it can now automatically retry the request after an appropriate delay, respecting the server's rate limits. The implementation supports the RFC-compliant Retry-After header in both delay-seconds (integer) and HTTP-date (RFC 2822) formats. If a past date is provided, Git retries immediately without waiting. Retry behavior is controlled by three new configuration options (http.maxRetries, http.retryAfter, and http.maxRetryTime) which are documented in git-config(1). The retry logic implements a fail-fast approach: if any delay (whether from server header or configuration) exceeds maxRetryTime, Git fails immediately with a clear error message rather than capping the delay. This provides better visibility into rate limiting issues. The implementation includes extensive test coverage for basic retry behavior, Retry-After header formats (integer and HTTP-date), configuration combinations, maxRetryTime limits, invalid header handling, environment variable overrides, and edge cases. Signed-off-by: Vaidas Pilkauskas <vaidas.pilkauskas@shopify.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16t2203: avoid suppressing git status exit codeJialong Wang
When git status is piped into grep, the exit status of the Git command is hidden by the pipeline. Capture the status output in a temporary file first, and then filter it as needed, so that any failure from git status is still noticed by the test suite. Signed-off-by: Jialong Wang <jerrywang183@yahoo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16t4211: add tests for -L with standard diff optionsMichael Montalbo
Now that -L output flows through the standard diff pipeline, verify that previously-ignored diff options work: formatting (--word-diff, --word-diff-regex, --no-prefix, --src/dst-prefix, --full-index, --abbrev), whitespace handling (-w, -b), output indicators (--output-indicator-new/old/context), direction reversal (-R), --color-moved, and pickaxe options (-S, -G). Signed-off-by: Michael Montalbo <mmontalbo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16line-log: route -L output through the standard diff pipelineMichael Montalbo
`git log -L` has always bypassed the standard diff pipeline. `dump_diff_hacky()` in line-log.c hand-rolls its own diff headers and hunk output, which means most diff formatting options are silently ignored. A NEEDSWORK comment has acknowledged this since the feature was introduced: /* * NEEDSWORK: manually building a diff here is not the Right * Thing(tm). log -L should be built into the diff pipeline. */ Remove `dump_diff_hacky()` and its helpers and route -L output through `builtin_diff()` / `fn_out_consume()`, the same path used by `git diff` and `git log -p`. The mechanism is a pair of callback wrappers that sit between `xdi_diff_outf()` and `fn_out_consume()`, filtering xdiff's output to only the tracked line ranges. To ensure xdiff emits all lines within each range as context, the context length is inflated to span the largest range. Wire up the `-L` implies `--patch` default in revision setup rather than forcing it at output time, so `line_log_print()` is just `diffcore_std()` + `diff_flush()` with no format save/restore. Rename detection is a no-op since pairs are already resolved during the history walk in `queue_diffs()`, but running `diffcore_std()` means `-S`/`-G` (pickaxe), `--orderfile`, and `--diff-filter` now work with `-L`, and `diff_resolve_rename_copy()` sets pair statuses correctly without manual assignment. Switch `diff_filepair_dup()` from `xmalloc` to `xcalloc` so that new fields (including `line_ranges`) are zero-initialized by default. As a result, diff formatting options that were previously silently ignored (e.g. --word-diff, --no-prefix, -w, --color-moved) now work with -L, and output gains `index` lines, `new file mode` headers, and funcname context in `@@` headers. This is a user-visible output change: tools that parse -L output may need to handle the additional header lines. The context-length inflation means xdiff may process more output than needed for very wide line ranges, but benchmarks on files up to 7800 lines show no measurable regression. Signed-off-by: Michael Montalbo <mmontalbo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16line-log: fix crash when combined with pickaxe optionsMichael Montalbo
queue_diffs() passes the caller's diff_options, which may carry user-specified pickaxe state, to diff_tree_oid() and diffcore_std() when detecting renames for line-level history tracking. When pickaxe options are present on the command line (-G and -S to filter by text pattern, --find-object to filter by object identity), diffcore_std() also runs diffcore_pickaxe(), which may discard diff pairs that are relevant for rename detection. Losing those pairs breaks rename following. Before a2bb801f6a (line-log: avoid unnecessary full tree diffs, 2019-08-21), this silently truncated history at rename boundaries. That commit moved filter_diffs_for_paths() inside the rename- detection block, so it only runs when diff_might_be_rename() returns true. When pickaxe discards a rename pair, the rename goes undetected, and a deletion pair at a subsequent commit passes through uncleaned, reaching process_diff_filepair() with an invalid filespec and triggering an assertion failure. Fix this by building a private diff_options for the rename-detection path inside queue_diffs(), following the same pattern used by blame's find_rename(). This isolates the rename machinery from unrelated user-specified options. Reported-by: Matthew Hughes <matthewhughes934@gmail.com> Signed-off-by: Michael Montalbo <mmontalbo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16refs: add 'preparing' phase to the reference-transaction hookEric Ju
The "reference-transaction" hook is invoked multiple times during a ref transaction. Each invocation corresponds to a different phase: - The "prepared" phase indicates that references have been locked. - The "committed" phase indicates that all updates have been written to disk. - The "aborted" phase indicates that the transaction has been aborted and that all changes have been rolled back. This hook can be used to learn about the updates that Git wants to perform. For example, forges use it to coordinate reference updates across multiple nodes. However, the phases are insufficient for some specific use cases. The earliest observable phase in the "reference-transaction" hook is "prepared", at which point Git has already taken exclusive locks on every affected reference. This makes it suitable for last-chance validation, but not for serialization. So by the time a hook sees the "prepared" phase, it has no way to defer locking, and thus it cannot rearrange multiple concurrent ref transactions relative to one another. Introduce a new "preparing" phase that runs before the "prepared" phase, that is before Git acquires any reference lock on disk. This gives callers a well-defined window to perform validation, enable higher-level ordering of concurrent transactions, or reject the transaction entirely, all without interfering with the locking state. This change is strictly speaking not backwards compatible. Existing hook scripts that do not know how to handle unknown phases may treat 'preparing' as an error and return non-zero. But the hook is considered to expose internal implementation details of how Git works, and as such we have been a bit more lenient with changing its exact semantics, like for example in a8ae923f85 (refs: support symrefs in 'reference-transaction' hook, 2024-05-07). An alternative would be to introduce a "reference-transaction-v2" hook that knows about the new phase. This feels like a rather heavy-weight option though, and was thus discarded. Helped-by: Patrick Steinhardt <ps@pks.im> Helped-by: Justin Tobler <jltobler@gmail.com> Helped-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Eric Ju <eric.peijian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16t4200: convert test -[df] checks to test_path_* helpersPRASHANT S BISHT
Replace old-style path existence checks in t4200-rerere.sh with the appropriate test_path_* helper functions. These helpers provide clearer diagnostic messages on failure than the raw shell test builtin. Signed-off-by: Prashant S Bisht <prashantjee2025@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16apply.c: fix -p argument parsingMirko Faina
"git apply" has an option -p that takes an integer as its argument. Unfortunately the function apply_option_parse_p() in charge of parsing this argument uses atoi() to convert from string to integer, which allows a non-digit after the number (e.g. "1q") to be silently ignored. As a consequence, an argument that does not begin with a digit silently becomes a zero. Despite this command working fine when a non-positive argument is passed, it might be useful for the end user to know that their input contains non-digits that might've been unintended. Replace atoi() with strtol_i() to catch malformed inputs. Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16t0008: improve test cleanup to fix failing testMirko Faina
The "large exclude file ignored in tree" test fails. This is due to an additional warning message that is generated in the test. "warning: unable to access 'subdir/.gitignore': Too many levels of symbolic links", the extra warning that is not supposed to be there, happens because of some leftover files left by previous tests. To fix this we improve cleanup on "symlinks not respected in-tree", and because the tests in t0008 in general have poor cleanup, at the start of "large exclude file ignored in tree" we search for any leftover .gitignore and remove them before starting the test. Improve post-test cleanup and add pre-test cleanup to make sure that we have a workable environment for the test. Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16Merge branch 'mf/format-patch-cover-letter-format' into ↵Junio C Hamano
mf/format-patch-commit-list-format * mf/format-patch-cover-letter-format: docs: add usage for the cover-letter fmt feature format-patch: add commitListFormat config format-patch: add ability to use alt cover format format-patch: move cover letter summary generation pretty.c: add %(count) and %(total) placeholders
2026-03-16Merge branch 'ty/setup-error-tightening'Junio C Hamano
While discovering a ".git" directory, the code treats any stat() failure as a sign that a filesystem entity .git does not exist there, and ignores ".git" that is not a "gitdir" file or a directory. The code has been tightened to notice and report filesystem corruption better. * ty/setup-error-tightening: setup: improve error diagnosis for invalid .git files
2026-03-16Merge branch 'fp/t3310-unhide-git-failures'Junio C Hamano
The construct 'test "$(command)" = expectation' loses the exit status from the command, which has been fixed by breaking up the statement into pieces. * fp/t3310-unhide-git-failures: t3310: avoid hiding failures from rev-parse in command substitutions
2026-03-16Merge branch 'jt/repo-structure-extrema'Junio C Hamano
"git repo structure" command learns to report maximum values on various aspects of objects it inspects. * jt/repo-structure-extrema: builtin/repo: find tree with most entries builtin/repo: find commit with most parents builtin/repo: add OID annotations to table output builtin/repo: collect largest inflated objects builtin/repo: add helper for printing keyvalue output builtin/repo: update stats for each object
2026-03-16clar: update to fix compilation on platforms without PATH_MAXPatrick Steinhardt
Update clar to e4172e3 (Merge pull request #134 from clar-test/ethomson/const, 2026-01-10). Besides some changes to "generate.py" which don't have any impact on us, this commit also fixes compilation on platforms that don't have PATH_MAX, like for example GNU/Hurd. Reported-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-15t/pack-refs-tests: use test_path_is_missingRitesh Singh Jadoun
The pack-refs tests previously used raw 'test -f' and 'test -e' checks with negation. Update them to use Git's standard helper function test_path_is_missing for consistency and clearer failure reporting. As suggested in review, replaced the negated 'test_path_exists' with test_path_is_missing to better reflect the expected absence of paths. Signed-off-by: Ritesh Singh Jadoun <riteshjd75@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-13t0410: modernize delete_object helperSiddharth Shrimali
The delete_object helper currently relies on a manual sed command to calculate object paths. This works, but it's a bit brittle and forces us to maintain shell logic that Git's own test suite can already handle more elegantly. Switch to 'test_oid_to_path' to let Git handle the path logic. This makes the helper hash independent, which is much cleaner than manual string manipulation. While at it, use 'local' to declare helper-specific variables and quote them to follow Git's coding style. This prevents them from leaking into global shell scope and avoids potential naming conflicts with other parts of the test suite. Helped-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com> Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12fast-import: add mode to sign commits with invalid signaturesJustin Tobler
With git-fast-import(1), handling of signed commits is controlled via the `--signed-commits=<mode>` option. When an invalid signature is encountered, a user may want the option to sign the commit again as opposed to just stripping the signature. To facilitate this, introduce a "sign-if-invalid" mode for the `--signed-commits` option. Optionally, a key ID may be explicitly provided in the form `sign-if-invalid[=<keyid>]` to specify which signing key should be used when signing invalid commit signatures. Note that to properly support interoperability mode when signing commit signatures, the commit buffer must be created in both the repository and compatability object formats to generate the appropriate signatures accordingly. As currently implemented, the commit buffer for the compatability object format is not reconstructed and thus signing commits in interoperability mode is not yet supported. Support may be added in the future. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12Merge branch 'hn/status-compare-with-push'Junio C Hamano
"git status" learned to show comparison between the current branch and various other branches listed on status.compareBranches configuration. * hn/status-compare-with-push: status: clarify how status.compareBranches deduplicates status: add status.compareBranches config for multiple branch comparisons refactor format_branch_comparison in preparation
2026-03-12Merge branch 'ds/for-each-repo-w-worktree'Junio C Hamano
"git for-each-repo" started from a secondary worktree did not work as expected, which has been corrected. * ds/for-each-repo-w-worktree: for-each-repo: simplify passing of parameters for-each-repo: work correctly in a worktree run-command: extract sanitize_repo_env helper for-each-repo: test outside of repo context
2026-03-12Merge branch 'sp/send-email-validate-charset'Junio C Hamano
"git send-email" has learned to be a bit more careful when it accepts charset to use from the end-user, to avoid 'y' (mistaken 'yes' when expecting a charset like 'UTF-8') and other nonsense. * sp/send-email-validate-charset: send-email: validate charset name in 8bit encoding prompt
2026-03-12Merge branch 'ss/t9123-setup-inside-test-expect-success'Junio C Hamano
Test clean-up. * ss/t9123-setup-inside-test-expect-success: t9123: use test_when_finished for cleanup
2026-03-12Merge branch 'sk/oidmap-clear-with-custom-free-func'Junio C Hamano
A bit of OIDmap API enhancement and cleanup. * sk/oidmap-clear-with-custom-free-func: builtin/rev-list: migrate missing_objects cleanup to oidmap_clear_with_free() oidmap: make entry cleanup explicit in oidmap_clear
2026-03-12Merge branch 'ss/t3700-modernize'Junio C Hamano
Test clean-up. * ss/t3700-modernize: t3700: use test_grep helper for better diagnostics t3700: avoid suppressing git's exit code
2026-03-12Merge branch 'bc/sha1-256-interop-02'Junio C Hamano
The code to maintain mapping between object names in multiple hash functions is being added, written in Rust. * bc/sha1-256-interop-02: object-file-convert: always make sure object ID algo is valid rust: add a small wrapper around the hashfile code rust: add a new binary object map format rust: add functionality to hash an object rust: add a build.rs script for tests rust: fix linking binaries with cargo hash: expose hash context functions to Rust write-or-die: add an fsync component for the object map csum-file: define hashwrite's count as a uint32_t rust: add additional helpers for ObjectID hash: add a function to look up hash algo structs rust: add a hash algorithm abstraction rust: add a ObjectID struct hash: use uint32_t for object_id algorithm conversion: don't crash when no destination algo repository: require Rust support for interoperability
2026-03-12t9200: replace test -f with modern path helperPablo Sabater
Replace old style 'test -f' with helper 'test_path_is_file', which make debugging a failing test easier by loudly reporting what expectation was not met. Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11t: allow use of "sed -E"Junio C Hamano
Since early 2019 with e62e225f (test-lint: only use only sed [-n] [-e command] [-f command_file], 2019-01-20), we have been trying to limit the options of "sed" we use in our tests to "-e <pattern>", "-n", and "-f <file>". Before the commit, we were trying to reject only "-i" (which is one of the really-not-portable options), but the commit explicitly wanted to reject use of "-E" (use ERE instead of BRE). The commit cites the then-current POSIX.1 (Issue 7, 2018 edition) to show that "even recent POSIX does not have it!", but the latest edition (Issue 8) documents "-E" as an option to use ERE. But that was 7 years ago, and that is a long time for many things to happen. Besides, we have been using "sed -E" without the check in question triggering in one of the scripts since 2022, with 461fec41 (bisect run: keep some of the post-v2.30.0 output, 2022-11-10). It was hidden because the 'E' was squished with another single letter option. t/t6030-bisect-porcelain.sh: sed -En 's/.*(bisect... This escaped the rather simple pattern used in the checker /\bsed\s+-[^efn]\s+/ and err 'sed option not portable...'; because -E did not appear as a singleton. Let's change the rule to allow the "-E" option, which nobody has complained against for the past 3 years. We rewrite our first use of the "-E" option so that it is caught by the old rule, primarily because we do not want to teach our mischievous developers how to smuggle in an unwanted option undetected by the test lint. And at the same time, loosen the pattern to allow "-E" the same way we allow "-n" and friends. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11t9200: handle missing CVS with skip_allPablo Sabater
CVS initialization runs outside a test_expect_success and when it fails, the error report isn't good. Wrap CVS initialization in a skip_all check so when CVS initialization fails, the error report becomes clearer. Move the Git repo initialization into its own test_expect_success instead of being in the same CVS check. Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11help: cleanup the contruction of keys_uniqAmisha Chhajed
construction of keys_uniq depends on sort operation executed on keys before processing, which does not gurantee that keys_uniq will be sorted. refactor the code to shift the sort operation after the processing to remove dependency on key's sort operation and strictly maintain the sorted order of keys_uniq. move strbuf init and release out of loop to reuse same buffer. dedent sort -u and sed in tests and replace grep with sed, to avoid piping grep's output to sed. Suggested-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Amisha Chhajed <amishhhaaaa@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11test-lib: print escape sequence namesPablo Sabater
When printing expected/actual characters in failed checks, use their names (\a, \b, \n, ...) instead of their octal representation, making it easier to read. Add tests to test-example-tap.c Update t0080-unit-test-output.sh to match the desired output Teach 'print_one_char()' the equivalent name Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11t3200: replace hardcoded null OID with $ZERO_OIDSiddharth Shrimali
To support the SHA-256 transition, replace the hardcoded 40-zero string in 'git branch --merged' with '$ZERO_OID'. The current 40-character string causes the test to fail prematurely in SHA-256 environments because Git identifies a "malformed object name" (due to the 40 vs 64 character mismatch) before it even validates the object type. By using '$ZERO_OID', we ensure the hash length is always correct for the active algorithm. Additionally, use 'test_grep' to verify the "must point to a commit" error message, ensuring the test validates the object type logic rather than just string syntax. Suggested-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11list-objects-filter-options: avoid strbuf_split_str()Deveshi Dwivedi
parse_combine_filter() splits a combine: filter spec at '+' using strbuf_split_str(), which yields an array of strbufs with the delimiter left at the end of each non-final piece. The code then mutates each non-final piece to strip the trailing '+' before parsing. Allocating an array of strbufs is unnecessary. The function processes one sub-spec at a time and does not use strbuf editing on the pieces. The two helpers it calls, has_reserved_character() and parse_combine_subfilter(), only read the string content of the strbuf they receive. Walk the input string directly with strchrnul() to find each '+', copying each sub-spec into a reusable temporary buffer. The '+' delimiter is naturally excluded. Empty sub-specs (e.g. from a trailing '+') are silently skipped for consistency. Change the helpers to take const char * instead of struct strbuf *. The test that expected an error on a trailing '+' is removed, since that behavior was incorrect. Signed-off-by: Deveshi Dwivedi <deveshigurgaon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10t7605: use test_path_is_file instead of test -fMansi Singh
Replace old-style 'test -f' path checks with the modern test_path_is_file helper in the merge_c1_to_c2_cmds block. The helper provides clearer failure messages and is the established convention in Git's test suite. Signed-off-by: Mansi Singh <mansimaanu8627@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10Merge branch 'jh/alias-i18n-fixes'Junio C Hamano
Further update to the i18n alias support to avoid regressions. * jh/alias-i18n-fixes: doc: fix list continuation in alias.adoc git, help: fix memory leaks in alias listing alias: treat empty subsection [alias ""] as plain [alias] doc: fix list continuation in alias subsection example
2026-03-10Merge branch 'pt/fsmonitor-watchman-sample-fix'Junio C Hamano
Fix typo-induced breakages in fsmonitor-watchman sample hook. * pt/fsmonitor-watchman-sample-fix: fsmonitor-watchman: fix variable reference and remove redundant code
2026-03-10Merge branch 'mm/diff-no-index-find-object'Junio C Hamano
"git diff --no-index --find-object=<object-name>" outside a repository of course wouldn't be able to find the object and died while parsing the command line, which is made to die in a bit more user-friendly way. * mm/diff-no-index-find-object: diff: fix crash with --find-object outside repository
2026-03-10Merge branch 'fp/t3310-test-path-is-helpers'Junio C Hamano
Test clean-up. * fp/t3310-test-path-is-helpers: t3310: replace test -f/-d with test_path_is_file/test_path_is_dir
2026-03-10Merge branch 'ss/test-that-that-typofix'Junio C Hamano
Typofix in t/. * ss/test-that-that-typofix: t: fix "that that" typo in lib-unicode-nfc-nfd.sh
2026-03-10Merge branch 'ar/config-hooks'Junio C Hamano
Allow hook commands to be defined (possibly centrally) in the configuration files, and run multiple of them for the same hook event. * ar/config-hooks: hook: add -z option to "git hook list" hook: allow out-of-repo 'git hook' invocations hook: allow event = "" to overwrite previous values hook: allow disabling config hooks hook: include hooks from the config hook: add "git hook list" command hook: run a list of hooks to prepare for multihook support hook: add internal state alloc/free callbacks
2026-03-10Merge branch 'kh/format-patch-noprefix-is-boolean'Junio C Hamano
The configuration variable format.noprefix did not behave as a proper boolean variable, which has now been fixed and documented. * kh/format-patch-noprefix-is-boolean: doc: diff-options.adoc: make *.noprefix split translatable doc: diff-options.adoc: show format.noprefix for format-patch format-patch: make format.noprefix a boolean
2026-03-09Merge branch 'lp/diff-stat-utf8-display-width-fix'Junio C Hamano
"git log --graph --stat" did not count the display width of colored graph part of its own output correctly, which has been corrected. * lp/diff-stat-utf8-display-width-fix: t4052: test for diffstat width when prefix contains ANSI escape codes diff: handle ANSI escape codes in prefix when calculating diffstat width
2026-03-09Merge branch 'cs/add-skip-submodule-ignore-all'Junio C Hamano
"git add <submodule>" has been taught to honor submodule.<name>.ignore that is set to "all" (and requires "git add -f" to override it). * cs/add-skip-submodule-ignore-all: Documentation: update add --force option + ignore=all config tests: fix existing tests when add an ignore=all submodule tests: t2206-add-submodule-ignored: ignore=all and add --force tests read-cache: submodule add need --force given ignore=all configuration read-cache: update add_files_to_cache take param ignored_too
2026-03-09Merge branch 'ps/refs-for-each'Junio C Hamano
Code refactoring around refs-for-each-* API functions. * ps/refs-for-each: refs: replace `refs_for_each_fullref_in()` refs: replace `refs_for_each_namespaced_ref()` refs: replace `refs_for_each_glob_ref()` refs: replace `refs_for_each_glob_ref_in()` refs: replace `refs_for_each_rawref_in()` refs: replace `refs_for_each_rawref()` refs: replace `refs_for_each_ref_in()` refs: improve verification for-each-ref options refs: generalize `refs_for_each_fullref_in_prefixes()` refs: generalize `refs_for_each_namespaced_ref()` refs: speed up `refs_for_each_glob_ref_in()` refs: introduce `refs_for_each_ref_ext` refs: rename `each_ref_fn` refs: rename `do_for_each_ref_flags` refs: move `do_for_each_ref_flags` further up refs: move `refs_head_ref_namespaced()` refs: remove unused `refs_for_each_include_root_ref()`
2026-03-09Merge branch 'ar/run-command-hook-take-2'Junio C Hamano
Use the hook API to replace ad-hoc invocation of hook scripts via the run_command() API. * ar/run-command-hook-take-2: builtin/receive-pack: avoid spinning no-op sideband async threads receive-pack: convert receive hooks to hook API receive-pack: convert update hooks to new API run-command: poll child input in addition to output hook: add jobs option reference-transaction: use hook API instead of run-command transport: convert pre-push to hook API hook: allow separate std[out|err] streams hook: convert 'post-rewrite' hook in sequencer.c to hook API hook: provide stdin via callback run-command: add stdin callback for parallelization run-command: add helper for pp child states t1800: add hook output stream tests