diff options
author | Thomas Bracht Laumann Jespersen <t@laumann.xyz> | 2022-08-06 22:08:12 +0200 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-08-12 16:44:07 +0100 |
commit | 33c5ec8d6f509841240464f248514320800f1229 (patch) | |
tree | bcde32610ce6b2071ced6cdcaae847170e9fac62 /dev-vcs/git/files/git-2.37.2-unsafe-directory.patch | |
parent | dev-vcs/git: add 2.37.2 (diff) | |
download | gentoo-33c5ec8d6f509841240464f248514320800f1229.tar.gz gentoo-33c5ec8d6f509841240464f248514320800f1229.tar.bz2 gentoo-33c5ec8d6f509841240464f248514320800f1229.zip |
dev-vcs/git: allow disabling "safe.directory"
Add IUSE="+safe-directory" that when not enabled, makes the
safe.directory configuration setting not take effect. The patch is meant
to be the smallest change (in terms of lines of code) that would let the
feature work for tests still.
Bug: https://github.com/pkgcore/pkgcheck/issues/412
Bug: https://bugs.gentoo.org/857831
Bug: https://bugs.gentoo.org/838127
Bug: https://bugs.gentoo.org/838223
Bug: https://bugs.gentoo.org/838271
Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
Closes: https://github.com/gentoo/gentoo/pull/26762
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-vcs/git/files/git-2.37.2-unsafe-directory.patch')
-rw-r--r-- | dev-vcs/git/files/git-2.37.2-unsafe-directory.patch | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/dev-vcs/git/files/git-2.37.2-unsafe-directory.patch b/dev-vcs/git/files/git-2.37.2-unsafe-directory.patch new file mode 100644 index 000000000000..27bf5413753a --- /dev/null +++ b/dev-vcs/git/files/git-2.37.2-unsafe-directory.patch @@ -0,0 +1,14 @@ +Neuter the "safe directory" feature, except for tests. +--- a/setup.c ++++ b/setup.c +@@ -1157,7 +1157,9 @@ static int ensure_valid_ownership(const char *gitfile, + */ + read_very_early_config(safe_directory_cb, &data); + +- return data.is_safe; ++ if (git_env_bool("GIT_TEST_ASSUME_DIFFERENT_OWNER", 0)) ++ return data.is_safe; ++ return 1; + } + + enum discovery_result { |