Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for v2.27.0 #2724

Open
wants to merge 46 commits into
base: origin-v2.27.0-1733768981
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ecc84ec
commit patch 21142154
Dec 9, 2024
6551c6f
commit patch 20508084
Dec 9, 2024
367599e
commit patch 20254886
Dec 9, 2024
837e807
commit patch 19220045
Dec 9, 2024
2aa80ea
commit patch 22178598
Dec 9, 2024
9ed5129
commit patch 27060058
Dec 9, 2024
fa648bc
commit patch 26108761
Dec 9, 2024
ccc3831
commit patch 17404851
Dec 9, 2024
819e4b2
commit patch 20360466
Dec 9, 2024
34dc45c
commit patch 24861532
Dec 9, 2024
8ef363b
commit patch 27990692
Dec 9, 2024
8938782
commit patch 24078194
Dec 9, 2024
ed43d34
commit patch 26425651
Dec 9, 2024
99e6eca
commit patch 18355207
Dec 9, 2024
fccf76c
commit patch 25495350
Dec 9, 2024
6a4aa96
commit patch 27843077
Dec 9, 2024
0eeddd3
commit patch 22368775
Dec 9, 2024
182961b
commit patch 21755901
Dec 9, 2024
7539375
commit patch 24966726
Dec 9, 2024
20d22e7
commit patch 27800733
Dec 9, 2024
429f903
commit patch 24586295
Dec 9, 2024
e0be287
commit patch 22727405
Dec 9, 2024
cbb111d
commit patch 26932799
Dec 9, 2024
b58ec20
commit patch 24205261
Dec 9, 2024
991f57d
commit patch 20169947
Dec 9, 2024
d4803cb
commit patch 23719185
Dec 9, 2024
55077cd
commit patch 26594662
Dec 9, 2024
02963b1
commit patch 22030236
Dec 9, 2024
223f729
commit patch 21502188
Dec 9, 2024
a6b6275
commit patch 19516109
Dec 9, 2024
1d577c3
commit patch 23803413
Dec 9, 2024
386aa75
commit patch 24966727
Dec 9, 2024
fc1d6c5
commit patch 21650216
Dec 9, 2024
3e1753a
commit patch 28011879
Dec 9, 2024
02527b9
commit patch 23888039
Dec 9, 2024
4497285
commit patch 20508083
Dec 9, 2024
9bde887
commit patch 26467788
Dec 9, 2024
5339765
commit patch 23254526
Dec 9, 2024
1ab6ab9
commit patch 22874846
Dec 9, 2024
e943ada
commit patch 24184054
Dec 9, 2024
482c2b1
commit patch 17446710
Dec 9, 2024
39eb105
commit patch 28033057
Dec 9, 2024
c402bae
commit patch 24649854
Dec 9, 2024
8fc2448
commit patch 19304891
Dec 9, 2024
04fb86d
commit patch 21861067
Dec 9, 2024
fdcbf72
commit patch 26087432
Dec 9, 2024
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
Prev Previous commit
Next Next commit
commit patch 20360466
  • Loading branch information
turly221 committed Dec 9, 2024
commit 819e4b28066478c31aa0332fb090602a934ee2ea
7 changes: 7 additions & 0 deletions Documentation/config/safe.txt
Original file line number Diff line number Diff line change
@@ -19,3 +19,10 @@ line option `-c safe.directory=<path>`.
The value of this setting is interpolated, i.e. `~/<path>` expands to a
path relative to the home directory and `%(prefix)/<path>` expands to a
path relative to Git's (runtime) prefix.
+
To completely opt-out of this security check, set `safe.directory` to the
string `*`. This will allow all repositories to be treated as if their
directory was listed in the `safe.directory` list. If `safe.directory=*`
is set in system config and you want to re-enable this protection, then
initialize your list with an empty value before listing the repositories
that you deem safe.
6 changes: 4 additions & 2 deletions setup.c
Original file line number Diff line number Diff line change
@@ -933,9 +933,11 @@ static int safe_directory_cb(const char *key, const char *value, void *d)
if (strcmp(key, "safe.directory"))
return 0;

if (!value || !*value)
if (!value || !*value) {
data->is_safe = 0;
else {
} else if (!strcmp(value, "*")) {
data->is_safe = 1;
} else {
const char *interpolated = NULL;

if (!git_config_pathname(&interpolated, key, value) &&
3 changes: 3 additions & 0 deletions setup.c.orig
Original file line number Diff line number Diff line change
@@ -930,6 +930,9 @@ static int safe_directory_cb(const char *key, const char *value, void *d)
{
struct safe_directory_data *data = d;

if (strcmp(key, "safe.directory"))
return 0;

if (!value || !*value)
data->is_safe = 0;
else {
10 changes: 10 additions & 0 deletions t/t0033-safe-directory.sh
Original file line number Diff line number Diff line change
@@ -36,4 +36,14 @@ test_expect_success 'safe.directory matches, but is reset' '
expect_rejected_dir
'

test_expect_success 'safe.directory=*' '
git config --global --add safe.directory "*" &&
git status
'

test_expect_success 'safe.directory=*, but is reset' '
git config --global --add safe.directory "" &&
expect_rejected_dir
'

test_done