diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-05-10 19:07:34 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-05-10 12:20:44 -0700 |
commit | b6551feadfda76379a28f424ea46998e2b995d07 (patch) | |
tree | a71d7af92591ac20c7aca8904357ec84d7039ea1 /builtin/patch-id.c | |
parent | 0d1bd1dfb37ef25e1911777c94129fc769ffec38 (diff) | |
download | git-b6551feadfda76379a28f424ea46998e2b995d07.tar.gz |
merge-tree: load default git config
The 'git merge-tree' command handles creating root trees for merges
without using the worktree. This is a critical operation in many Git
hosts, as they typically store bare repositories.
This builtin does not load the default Git config, which can have
several important ramifications.
In particular, one config that is loaded by default is
core.useReplaceRefs. This is typically disabled in Git hosts due to
the ability to spoof commits in strange ways.
Since this config is not loaded specifically during merge-tree, users
were previously able to use refs/replace/ references to make pull
requests that looked valid but introduced malicious content. The
resulting merge commit would have the correct commit history, but the
malicious content would exist in the root tree of the merge.
The fix is simple: load the default Git config in cmd_merge_tree().
This may also fix other behaviors that are effected by reading default
config. The only possible downside is a little extra computation time
spent reading config. The config parsing is placed after basic argument
parsing so it does not slow down usage errors.
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/patch-id.c')
0 files changed, 0 insertions, 0 deletions