Skip to content
Open

E #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
df67d73
config: retry acquiring config.lock, configurable via core.configLock…
Mic92 May 17, 2026
5bd3978
commit-reach: reject cycles in contains walk
tamird Jun 12, 2026
ca96eee
ref-filter: memoize --contains with generations
tamird Jun 12, 2026
ff3ba7d
commit-reach: die on contains walk errors
tamird Jun 12, 2026
de1e62e
Merge branch 'ps/refs-writing-subcommands' into ps/refs-wo-the-reposi…
gitster Jul 9, 2026
0201d27
repository: introduce repo_config_values_clear()
malon7782 Jul 14, 2026
7488b9d
environment: move excludes_file into repo_config_values
malon7782 Jul 14, 2026
469e95c
environment: move editor_program into repo_config_values
malon7782 Jul 14, 2026
e57125d
environment: move pager_program into repo_config_values
malon7782 Jul 14, 2026
48cbe40
environment: move askpass_program into repo_config_values
malon7782 Jul 14, 2026
a9f5e90
environment: migrate apply_default_whitespace and apply_default_ignor…
malon7782 Jul 14, 2026
1a6c84e
environment: move push_default into repo_config_values
malon7782 Jul 14, 2026
1840ca0
environment: move autorebase into repo_config_values
malon7782 Jul 14, 2026
b5efc34
environment: move object_creation_mode into repo_config_values
malon7782 Jul 14, 2026
5eac7ac
repository: adjust the comment of config_values_private_
malon7782 Jul 14, 2026
641588b
lib-log-graph: move check_graph function
pabloosabaterr Jul 14, 2026
08a0bef
revision: add next_commit_to_show()
pabloosabaterr Jul 14, 2026
bf3c696
graph: add a 2 commit buffer for lookahead
pabloosabaterr Jul 14, 2026
a34c00d
graph: indent visual root in graph
pabloosabaterr Jul 14, 2026
233cc40
graph: wrap cascading commits after 4 columns
pabloosabaterr Jul 14, 2026
f3a0330
graph: move config reading into graph_read_config()
pabloosabaterr Jul 14, 2026
e9b5720
graph: add --[no-]graph-indent and log.graphIndent
pabloosabaterr Jul 14, 2026
8aad1df
tempfile: add repo_create_tempfile{,_mode}()
rscharfe Jul 14, 2026
8432a4d
refs/packed: use repo_create_tempfile()
rscharfe Jul 14, 2026
d43f701
lockfile: add repo_hold_lock_file_for_update{,_timeout}{,_mode}()
rscharfe Jul 14, 2026
75e05f6
tempfile: stop using the_repository
rscharfe Jul 14, 2026
2e486bf
use repo_hold_lock_file_for_update{,_mode,_timeout}() with custom repos
rscharfe Jul 14, 2026
88101d3
t3400: restore coverage for note copying with apply backend
phillipwood Jul 15, 2026
1da8592
sequencer: be more careful with external merge
phillipwood Jul 15, 2026
18f5750
sequencer: never reschedule on failed commit
phillipwood Jul 15, 2026
6bb740d
sequencer: remove unnecessary "or" in pick_one_commit()
phillipwood Jul 15, 2026
dc0e2ac
sequencer: simplify handling of fixup with conflicts
phillipwood Jul 15, 2026
871f900
sequencer: remove unnecessary condition in pick_one_commit()
phillipwood Jul 15, 2026
034deee
sequencer: simplify pick_one_commit()
phillipwood Jul 15, 2026
a7dbb3a
sequencer: use an enum to represent result of picking a commit
phillipwood Jul 15, 2026
42554b7
sequencer: do not record dropped commits as rewritten
phillipwood Jul 15, 2026
3279c13
submodule--helper: avoid use of %zu for now
gitster Jul 15, 2026
f749a83
remote-curl: simplify passing of push specs
rscharfe Jul 15, 2026
5abbd7c
refs/packed: de-globalize handling of "core.packedRefsTimeout"
pks-t Jul 16, 2026
af57f73
refs/files: drop `USE_THE_REPOSITORY_VARIABLE`
pks-t Jul 16, 2026
28723da
worktree: refactor code to use available repositories
pks-t Jul 16, 2026
2cec1c9
worktree: pass repository to file-local functions
pks-t Jul 16, 2026
e2533e0
worktree: pass repository to public functions
pks-t Jul 16, 2026
b1296cb
refs: remove remaining uses of `the_repository`
pks-t Jul 16, 2026
991ec27
refspec: group related structures and functions
pks-t Jul 16, 2026
bb71c3f
refspec: let callers pass in hash algorithm when parsing items
pks-t Jul 16, 2026
01f4b61
refspec: stop depending on `the_repository`
pks-t Jul 16, 2026
0717b35
copy: drop dependency on `the_repository`
pks-t Jul 16, 2026
fda513d
gitweb: shorten index hashes with trailing file modes
TravorLZH Jul 17, 2026
9306f4f
Merge branch 'jt/receive-pack-use-odb-transactions' into HEAD
gitster Jul 19, 2026
215d305
odb: compute compat object ID in `odb_write_object_ext()`
pks-t Jul 17, 2026
cb5192e
t/u-odb-inmemory: implement wrapper for writing objects
pks-t Jul 17, 2026
46a586a
odb: compute object hash in `odb_write_object_ext()`
pks-t Jul 17, 2026
b688086
odb: lift object existence check out of the "loose" backend
pks-t Jul 17, 2026
8d9135d
odb: support setting mtime when writing objects
pks-t Jul 17, 2026
0e002f6
object-file: fix memory leak in `force_object_loose()`
pks-t Jul 17, 2026
627d3b7
object-file: force objects loose via generic interface
pks-t Jul 17, 2026
a6c1e16
object-file: move `force_object_loose()`
pks-t Jul 17, 2026
810f8b2
object-file: move logic to write loose objects
pks-t Jul 17, 2026
7b2648f
wt-status: avoid repeated insertion for untracked paths
sahitya-chandra Jul 18, 2026
251e7af
hash: initialize context before cloning
bk2204 Jul 19, 2026
fdfcd75
rust: discard hash context when finished
bk2204 Jul 19, 2026
8817d79
read-cache: remove redundant extern declarations
malon7782 Jul 20, 2026
b7b6e9e
read-cache: pass 'repo' to 'ce_mode_from_stat()'
malon7782 Jul 20, 2026
99c79da
environment: move trust_executable_bit into repo_config_values
malon7782 Jul 20, 2026
df2bc04
environment: move has_symlinks into repo_config_values
malon7782 Jul 20, 2026
dd674df
pathspec: use match for sparse-index expansion checks
tnm-oai Jul 20, 2026
1be6ebe
stash: avoid sparse-index expansion for in-cone paths
tnm-oai Jul 20, 2026
113d62b
userdiff: add support for Swift
shkuls Jul 21, 2026
840eb9a
transport-helper: fix memory leak of helper on disconnect
pabloosabaterr Jul 24, 2026
f05e099
cat-file: declare loop counter inside for()
peijianju Jul 24, 2026
fb60c49
t1006: extract helper functions into new 'lib-cat-file.sh'
peijianju Jul 24, 2026
b54d5e1
fetch-pack: drop the static advertise_sid variable
pabloosabaterr Jul 24, 2026
b72559c
fetch-pack: use unsigned int for hash_algo variable
pabloosabaterr Jul 24, 2026
40865f7
fetch-pack: move write_fetch_command_and_capabilities() to connect.c
pabloosabaterr Jul 24, 2026
eb1fbc6
connect: make write_fetch_command_and_capabilities() more generic
pabloosabaterr Jul 24, 2026
24f082e
fetch-pack: move fetch initialization
calvin-wan-google Jul 24, 2026
e44aca6
protocol-caps: check object existence regardless of the attributes re…
pabloosabaterr Jul 24, 2026
7dcbd35
serve: advertise object-info feature
calvin-wan-google Jul 24, 2026
12a19ee
transport: add client support for object-info
calvin-wan-google Jul 24, 2026
0ae93f5
cat-file: add remote-object-info to batch-command
peijianju Jul 24, 2026
dd1968b
cat-file: make remote-object-info allow-list adapt to the server
pabloosabaterr Jul 24, 2026
fbf123a
Merge branch 'ps/shift-root-in-graph'
gitster Jul 27, 2026
f931547
Merge branch 'jc/submodule-helper-avoid-zu'
gitster Jul 27, 2026
0c20b08
Merge branch 'ps/refs-wo-the-repository'
gitster Jul 27, 2026
ebc9fb5
Merge branch 'td/ref-filter-memoize-contains'
gitster Jul 27, 2026
f97a43e
Merge branch 'rs/remote-curl-simplify-push-specs'
gitster Jul 27, 2026
4be0a34
Merge branch 'ps/refspec-wo-the-repository'
gitster Jul 27, 2026
7d64c1e
Merge branch 'sc/wt-status-avoid-quadratic-insertion'
gitster Jul 27, 2026
bb8bc69
Merge branch 'ps/copy-wo-the-repository'
gitster Jul 27, 2026
f364885
Merge branch 'pw/rebase-drop-notes-with-commit'
gitster Jul 27, 2026
47ea9e4
Merge branch 'bc/rust-hash-cleanups'
gitster Jul 27, 2026
13c7afe
The 8th batch
gitster Jul 27, 2026
818eb57
Merge branch 'rs/tempfile-wo-the-repository'
gitster Jul 30, 2026
48d45c7
Merge branch 'ty/migrate-trust-executable-bit'
gitster Jul 30, 2026
fc1e758
Merge branch 'ty/migrate-excludes-file'
gitster Jul 30, 2026
da12976
Merge branch 'sk/userdiff-swift'
gitster Jul 30, 2026
50f7f93
Merge branch 'tn/stash-avoid-sparse-index-expansion'
gitster Jul 30, 2026
ab7ed92
Merge branch 'jt/config-lock-timeout'
gitster Jul 30, 2026
e1fb641
Merge branch 'ps/cat-file-remote-object-info'
gitster Jul 30, 2026
554ef25
Merge branch 'tl/gitweb-shorten-hashes-with-modes'
gitster Jul 30, 2026
d407e69
Merge branch 'ps/odb-move-loose-object-writing'
gitster Jul 30, 2026
a97fcc3
The 9th batch
gitster Jul 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions Documentation/RelNotes/2.56.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ UI, Workflows & Features
standardized to make them consistent with each other and with other
commands.

* 'git log --graph' has been modified to visually distinguish parentless
'root' commits (and commits that become roots due to history
simplification) by indenting them, preventing them from appearing
falsely related to unrelated commits rendered immediately above them.

* Userdiff patterns for Swift have been added, with support for
Swift-specific constructs such as attributes, modifiers, failable
initializers, and generics.

* Configuration file locking has been updated to retry for a short
period, avoiding failures when multiple processes attempt to update
the configuration simultaneously.

* The 'remote-object-info' command has been added to 'git cat-file
--batch-command', allowing clients to request object metadata
(currently size) from a remote server via protocol v2 without
downloading the entire object. Format placeholders are dynamically
filtered on the client based on server-advertised capabilities,
returning empty strings for inapplicable or unsupported fields.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -206,6 +226,60 @@ Performance, Internal Implementation, Development Support etc.
pathspec filtering, which was lost when the streaming walk was
refactored.

* The ref subsystem and the worktree API have been refactored to pass a
repository pointer down the call chain, allowing them to drop
references to the global 'the_repository' variable. As part of this,
the handling of the 'core.packedRefsTimeout' configuration has been
moved into the per-repository ref store structure.

* 'git branch --contains' and 'git for-each-ref --contains' have been
optimized to use the memoized commit traversal previously used only by
'git tag --contains', significantly speeding up connectivity checks
across many candidate refs with shared history.

* The passing of push destination specifications in the 'remote-curl'
helper has been simplified by removing the explicit 'count' parameter
and relying on the NULL-termination of the array.

* The dependency on the global 'the_repository' variable in the
'refspec.c' API has been removed by passing the hash algorithm
explicitly to refspec-parsing functions and storing it in 'struct
refspec'.

* The enumeration of untracked and ignored files in 'git status' has
been optimized by avoiding quadratic complexity when inserting into
string lists, reducing the construction cost from O(n^2) to O(n log
n).

* The copy_file() and copy_file_with_time() functions have been
refactored to take a repository parameter, allowing the removal of the
implicit dependency on the global 'the_repository' variable in
'copy.c'.

* The tempfile and lockfile APIs have been refactored to stop depending
on the 'the_repository' global variable, and their callers have been
updated to use the repository-aware variants.

* The 'trust_executable_bit' (coming from the 'core.filemode'
configuration) has been migrated into 'struct repo_config_values' to
tie it to a specific repository instance.

* The 'excludes_file' and various other global configuration variables
(including 'editor_program', 'pager_program', 'askpass_program', and
'push_default') have been migrated into the per-repository structure.

* The 'git stash push' command has been optimized to avoid unnecessary
sparse index expansion when pathspecs are wholly inside the
sparse-checkout cone. Also, a potential out-of-bounds read in the
sparse-index expansion check helper pathspec_needs_expanded_index()
has been fixed by consistently using the parsed, prefixed path.

* The logic to write loose objects has been refactored and moved from
'object-file.c' to the loose backend source file 'odb/source-loose.c',
making the loose backend more self-contained. This is achieved by
first refactoring force_object_loose() to use generic ODB write
interfaces instead of loose-backend internals.


Fixes since v2.55
-----------------
Expand Down Expand Up @@ -350,3 +424,24 @@ Fixes since v2.55
'git submodule update' command until it was broken in a modernization
of the option-parsing code, has been restored.
(merge ff1da37f58 dm/submodule-update-i-shorthand later to maint).

* An accidental use of the '%zu' format specifier in 'git
submodule--helper' has been corrected to use 'PRIuMAX' and cast the
value to 'uintmax_t' to avoid portability issues.
(merge 3279c13c00 jc/submodule-helper-avoid-zu later to maint).

* The rebase post-rewrite notes-copying logic has been corrected. When
a commit is dropped during rebase (e.g., because its changes are
already upstream), it is no longer recorded as rewritten, preventing
its notes from being copied to an unrelated commit.
(merge 42554b78fd pw/rebase-drop-notes-with-commit later to maint).

* A few memory problems in the Rust interface to C hash functions have
been corrected. The 'Clone' implementation of 'CryptoHasher' now
properly initializes the context before cloning, and its 'Drop'
implementation now discards the context to prevent leaks.

* The object ID shortening and linking in the 'commitdiff' view of
'gitweb' has been corrected to work even when the index line carries
a trailing file mode.
(merge fda513d6fe tl/gitweb-shorten-hashes-with-modes later to maint).
8 changes: 8 additions & 0 deletions Documentation/config/core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,14 @@ core.packedRefsTimeout::
all; -1 means to try indefinitely. Default is 1000 (i.e.,
retry for 1 second).

core.configLockTimeout::
The length of time, in milliseconds, to retry when trying to
lock a configuration file for writing. Value 0 means not to
retry at all; -1 means to try indefinitely. Default is 1000
(i.e., retry for 1 second). This is read from the configuration
that is already on disk before the lock is taken, so it can be
set persistently like any other option.

core.pager::
Text viewer for use by Git commands (e.g., 'less'). The value
is meant to be interpreted by the shell. The order of preference
Expand Down
4 changes: 4 additions & 0 deletions Documentation/config/log.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ This is the same as the `--decorate` option of the `git log`.
A list of colors, separated by commas, that can be used to draw
history lines in `git log --graph`.

`log.graphIndent`::
If `true`, indent visual roots when rendering the graphs with `--graph`.
Set true by default. It can be overriden with `--[no-]graph-indent`.

`log.showRoot`::
If true, the initial commit will be shown as a big creation event.
This is equivalent to a diff against an empty tree.
Expand Down
23 changes: 21 additions & 2 deletions Documentation/git-cat-file.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ info <object>::
Print object info for object reference `<object>`. This corresponds to the
output of `--batch-check`.

remote-object-info <remote> <object>...::
Print object info for object references `<object>` at specified
`<remote>` without downloading objects from the remote.
Raise an error when the `object-info` capability is not supported by the remote.
Raise an error when no object references are provided.
This command may be combined with `--buffer`.

flush::
Used with `--buffer` to execute all preceding commands that were issued
since the beginning or since the last flush was issued. When `--buffer`
Expand Down Expand Up @@ -301,7 +308,8 @@ one per line, and print information based on the command given. With
`--batch-command`, the `info` command followed by an object will print
information about the object the same way `--batch-check` would, and the
`contents` command followed by an object prints contents in the same way
`--batch` would.
`--batch` would. The `remote-object-info` command followed by a remote and
object IDs prints object info from the remote without downloading the objects.

You can specify the information shown for each object by using a custom
`<format>`. The `<format>` is copied literally to stdout for each
Expand Down Expand Up @@ -340,8 +348,15 @@ newline. The available atoms are:
after that first run of whitespace (i.e., the "rest" of the
line) are output in place of the `%(rest)` atom.

The command `remote-object-info` only supports the `%(objectname)` and
`%(objectsize)` placeholders. See `CAVEATS` below for more information.

If no format is specified, the default format is `%(objectname)
%(objecttype) %(objectsize)`.
%(objecttype) %(objectsize)`, except for `remote-object-info` commands which
use `%(objectname) %(objectsize)` because `%(objecttype)` is not supported yet.

WARNING: When "%(objecttype)" is supported, the default format WILL be unified,
so DO NOT RELY on the current default format to stay the same!!!

If `--batch` is specified, or if `--batch-command` is used with the `contents`
command, the object information is followed by the object contents (consisting
Expand Down Expand Up @@ -438,6 +453,10 @@ scripting purposes.
CAVEATS
-------

Note that only `%(objectname)` and `%(objectsize)` are currently
supported by the `remote-object-info` command. Using any other placeholder in
the format string will return an empty string in its position.

Note that the sizes of objects on disk are reported accurately, but care
should be taken in drawing conclusions about which refs or objects are
responsible for disk usage. The size of a packed non-delta object may be
Expand Down
2 changes: 2 additions & 0 deletions Documentation/gitattributes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,8 @@ patterns are available:
- `scheme` suitable for source code in most Lisp dialects,
including Scheme, Emacs Lisp, Common Lisp, and Clojure.

- `swift` suitable for source code in the Swift language.

- `tex` suitable for source code for LaTeX documents.


Expand Down
21 changes: 13 additions & 8 deletions Documentation/gitprotocol-v2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -568,21 +568,26 @@ An `object-info` request takes the following arguments:

oid <oid>
Indicates to the server an object which the client wants to obtain
information for.
information for. They must be full OIDs.

The response of `object-info` is a list of the requested object ids
and associated requested information, each separated by a single space.
The response of `object-info` consists of one pkt-line per requested attribute,
echoing the attributes the server will report, followed by one pkt-line per
requested object id with its information, each field separated by a single
space.

output = info flush-pkt

info = PKT-LINE(attrs) LF)
*PKT-LINE(obj-info LF)

attrs = attr | attrs SP attrs
info = *PKT-LINE(attr LF)
*PKT-LINE(obj-info LF)

attr = "size"

obj-info = obj-id SP obj-size
obj-size = 1*DIGIT

obj-info = obj-id [SP [obj-size]]

If the server does not recognize the OID, the response will be `<oid> SP`
regardless of the number of attributes requested.

bundle-uri
~~~~~~~~~~
Expand Down
8 changes: 8 additions & 0 deletions Documentation/rev-list-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,14 @@ This implies the `--topo-order` option by default, but the
By default it is set to 0 (no limit), zero and negative values
are ignored and treated as no limit.

`--no-graph-indent`::
`--graph-indent`::
When used with `--graph`, indent visual roots (commits with no parents
or whose parents are not shown) to differentiate them from commits that
are vertically adjacent but unrelated. Enabled by default. Use
`--no-graph-indent` to disable or set `log.graphIndent` to set a
default preference.

ifdef::git-rev-list[]
`--count`::
Print a number stating how many commits would have been
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,7 @@ LIB_OBJS += ewah/ewah_io.o
LIB_OBJS += ewah/ewah_rlw.o
LIB_OBJS += exec-cmd.o
LIB_OBJS += fetch-negotiator.o
LIB_OBJS += fetch-object-info.o
LIB_OBJS += fetch-pack.o
LIB_OBJS += fmt-merge-msg.o
LIB_OBJS += fsck.o
Expand Down
44 changes: 29 additions & 15 deletions apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ struct gitdiff_data {
int p_value;
};

static void git_apply_config(void)
static void git_apply_config(struct repository *repo)
{
repo_config_get_string(the_repository, "apply.whitespace", &apply_default_whitespace);
repo_config_get_string(the_repository, "apply.ignorewhitespace", &apply_default_ignorewhitespace);
repo_config(the_repository, git_xmerge_config, NULL);
struct repo_config_values *cfg = repo_config_values(repo);

FREE_AND_NULL(cfg->apply_default_whitespace);
repo_config_get_string(repo, "apply.whitespace",
&cfg->apply_default_whitespace);
FREE_AND_NULL(cfg->apply_default_ignorewhitespace);
repo_config_get_string(repo, "apply.ignorewhitespace",
&cfg->apply_default_ignorewhitespace);
repo_config(repo, git_xmerge_config, NULL);
}

static int parse_whitespace_option(struct apply_state *state, const char *option)
Expand Down Expand Up @@ -109,6 +115,8 @@ int init_apply_state(struct apply_state *state,
struct repository *repo,
const char *prefix)
{
struct repo_config_values *cfg = repo_config_values(repo);

memset(state, 0, sizeof(*state));
state->prefix = prefix;
state->repo = repo;
Expand All @@ -126,10 +134,13 @@ int init_apply_state(struct apply_state *state,
strset_init(&state->kept_symlinks);
strbuf_init(&state->root, 0);

git_apply_config();
if (apply_default_whitespace && parse_whitespace_option(state, apply_default_whitespace))
git_apply_config(repo);

if (cfg->apply_default_whitespace &&
parse_whitespace_option(state, cfg->apply_default_whitespace))
return -1;
if (apply_default_ignorewhitespace && parse_ignorewhitespace_option(state, apply_default_ignorewhitespace))
if (cfg->apply_default_ignorewhitespace &&
parse_ignorewhitespace_option(state, cfg->apply_default_ignorewhitespace))
return -1;
return 0;
}
Expand Down Expand Up @@ -192,7 +203,8 @@ int check_apply_state(struct apply_state *state, int force_apply)

static void set_default_whitespace_mode(struct apply_state *state)
{
if (!state->whitespace_option && !apply_default_whitespace)
if (!state->whitespace_option &&
!repo_config_values(state->repo)->apply_default_whitespace)
state->ws_error_action = (state->apply ? warn_on_ws_error : nowarn_ws_error);
}

Expand Down Expand Up @@ -3893,8 +3905,8 @@ static int check_preimage(struct apply_state *state,
if (*ce && !(*ce)->ce_mode)
BUG("ce_mode == 0 for path '%s'", old_name);

if (trust_executable_bit || !S_ISREG(st->st_mode))
st_mode = ce_mode_from_stat(*ce, st->st_mode);
if (repo_trust_executable_bit(state->repo) || !S_ISREG(st->st_mode))
st_mode = ce_mode_from_stat(state->repo, *ce, st->st_mode);
else if (*ce)
st_mode = (*ce)->ce_mode;
else
Expand Down Expand Up @@ -4287,7 +4299,8 @@ static int build_fake_ancestor(struct apply_state *state, struct patch *list)
}
}

hold_lock_file_for_update(&lock, state->fake_ancestor, LOCK_DIE_ON_ERROR);
repo_hold_lock_file_for_update(state->repo, &lock, state->fake_ancestor,
LOCK_DIE_ON_ERROR);
res = write_locked_index(&result, &lock, COMMIT_LOCK);
discard_index(&result);

Expand Down Expand Up @@ -4511,7 +4524,7 @@ static int try_create_file(struct apply_state *state, const char *path,
return !!mkdir(path, 0777);
}

if (has_symlinks && S_ISLNK(mode))
if (repo_has_symlinks(state->repo) && S_ISLNK(mode))
/* Although buf:size is counted string, it also is NUL
* terminated.
*/
Expand Down Expand Up @@ -4945,9 +4958,10 @@ static int apply_patch(struct apply_state *state,
state->update_index = (state->check_index || state->ita_only) && state->apply;
if (state->update_index && !is_lock_file_locked(&state->lock_file)) {
if (state->index_file)
hold_lock_file_for_update(&state->lock_file,
state->index_file,
LOCK_DIE_ON_ERROR);
repo_hold_lock_file_for_update(state->repo,
&state->lock_file,
state->index_file,
LOCK_DIE_ON_ERROR);
else
repo_hold_locked_index(state->repo, &state->lock_file,
LOCK_DIE_ON_ERROR);
Expand Down
8 changes: 4 additions & 4 deletions branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int find_tracked_branch(struct remote *remote, void *priv)

static int should_setup_rebase(const char *origin)
{
switch (autorebase) {
switch (repo_config_values(the_repository)->autorebase) {
case AUTOREBASE_NEVER:
return 0;
case AUTOREBASE_LOCAL:
Expand Down Expand Up @@ -372,7 +372,7 @@ int read_branch_desc(struct strbuf *buf, const char *branch_name)
*/
int validate_branchname(const char *name, struct strbuf *ref)
{
if (check_branch_ref(ref, name)) {
if (check_branch_ref(the_repository, ref, name)) {
int code = die_message(_("'%s' is not a valid branch name"), name);
advise_if_enabled(ADVICE_REF_SYNTAX,
_("See 'git help check-ref-format'"));
Expand All @@ -394,7 +394,7 @@ static void prepare_checked_out_branches(void)
return;
initialized_checked_out_branches = 1;

worktrees = get_worktrees();
worktrees = get_worktrees(the_repository);

while (worktrees[i]) {
char *old, *wt_gitdir;
Expand Down Expand Up @@ -846,7 +846,7 @@ void remove_branch_state(struct repository *r, int verbose)

void die_if_checked_out(const char *branch, int ignore_current_worktree)
{
struct worktree **worktrees = get_worktrees();
struct worktree **worktrees = get_worktrees(the_repository);

for (int i = 0; worktrees[i]; i++) {
if (worktrees[i]->is_current && ignore_current_worktree)
Expand Down
Loading