update to 2.32.0-rc0
Release notes: https://github.com/git/git/raw/v2.32.0-rc0/Documentation/RelNotes/2.32.0.txt
This commit is contained in:
parent
b1bd88b45b
commit
e67c091cc6
@ -1,81 +0,0 @@
|
|||||||
From 7fc363e4e64f095553e1a1ceed27caef3a33effd Mon Sep 17 00:00:00 2001
|
|
||||||
From: "brian m. carlson" <sandals@crustytoothpaste.net>
|
|
||||||
Date: Wed, 10 Mar 2021 01:11:20 +0000
|
|
||||||
Subject: [PATCH] builtin/init-db: handle bare clones when core.bare set to
|
|
||||||
false
|
|
||||||
|
|
||||||
In 552955ed7f ("clone: use more conventional config/option layering",
|
|
||||||
2020-10-01), clone learned to read configuration options earlier in its
|
|
||||||
execution, before creating the new repository. However, that led to a
|
|
||||||
problem: if the core.bare setting is set to false in the global config,
|
|
||||||
cloning a bare repository segfaults. This happens because the
|
|
||||||
repository is falsely thought to be non-bare, but clone has set the work
|
|
||||||
tree to NULL, which is then dereferenced.
|
|
||||||
|
|
||||||
The code to initialize the repository already considers the fact that a
|
|
||||||
user might want to override the --bare option for git init, but it
|
|
||||||
doesn't take into account clone, which uses a different option. Let's
|
|
||||||
just check that the work tree is not NULL, since that's how clone
|
|
||||||
indicates that the repository is bare. This is also the case for git
|
|
||||||
init, so we won't be regressing that case.
|
|
||||||
|
|
||||||
Reported-by: Joseph Vusich <jvusich@amazon.com>
|
|
||||||
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
|
|
||||||
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
||||||
(cherry picked from commit 75555676ad3908b0f847a9ae154c35e12114c82f)
|
|
||||||
---
|
|
||||||
builtin/init-db.c | 4 ++--
|
|
||||||
t/t5606-clone-options.sh | 8 ++++++++
|
|
||||||
2 files changed, 10 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/builtin/init-db.c b/builtin/init-db.c
|
|
||||||
index dcc45bef51..f82efe4aff 100644
|
|
||||||
--- a/builtin/init-db.c
|
|
||||||
+++ b/builtin/init-db.c
|
|
||||||
@@ -212,6 +212,7 @@ static int create_default_files(const char *template_path,
|
|
||||||
int reinit;
|
|
||||||
int filemode;
|
|
||||||
struct strbuf err = STRBUF_INIT;
|
|
||||||
+ const char *work_tree = get_git_work_tree();
|
|
||||||
|
|
||||||
/* Just look for `init.templatedir` */
|
|
||||||
init_db_template_dir = NULL; /* re-set in case it was set before */
|
|
||||||
@@ -235,7 +236,7 @@ static int create_default_files(const char *template_path,
|
|
||||||
* We must make sure command-line options continue to override any
|
|
||||||
* values we might have just re-read from the config.
|
|
||||||
*/
|
|
||||||
- is_bare_repository_cfg = init_is_bare_repository;
|
|
||||||
+ is_bare_repository_cfg = init_is_bare_repository || !work_tree;
|
|
||||||
if (init_shared_repository != -1)
|
|
||||||
set_shared_repository(init_shared_repository);
|
|
||||||
|
|
||||||
@@ -299,7 +300,6 @@ static int create_default_files(const char *template_path,
|
|
||||||
if (is_bare_repository())
|
|
||||||
git_config_set("core.bare", "true");
|
|
||||||
else {
|
|
||||||
- const char *work_tree = get_git_work_tree();
|
|
||||||
git_config_set("core.bare", "false");
|
|
||||||
/* allow template config file to override the default */
|
|
||||||
if (log_all_ref_updates == LOG_REFS_UNSET)
|
|
||||||
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
|
|
||||||
index 1da6ddb2c5..428b0aac93 100755
|
|
||||||
--- a/t/t5606-clone-options.sh
|
|
||||||
+++ b/t/t5606-clone-options.sh
|
|
||||||
@@ -104,6 +104,14 @@ test_expect_success 'redirected clone -v does show progress' '
|
|
||||||
|
|
||||||
'
|
|
||||||
|
|
||||||
+test_expect_success 'clone does not segfault with --bare and core.bare=false' '
|
|
||||||
+ test_config_global core.bare false &&
|
|
||||||
+ git clone --bare parent clone-bare &&
|
|
||||||
+ echo true >expect &&
|
|
||||||
+ git -C clone-bare rev-parse --is-bare-repository >actual &&
|
|
||||||
+ test_cmp expect actual
|
|
||||||
+'
|
|
||||||
+
|
|
||||||
test_expect_success 'chooses correct default initial branch name' '
|
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
|
|
||||||
git -c init.defaultBranch=foo init --bare empty &&
|
|
||||||
--
|
|
||||||
2.31.1
|
|
||||||
|
|
14
git.spec
14
git.spec
@ -76,11 +76,11 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Define for release candidates
|
# Define for release candidates
|
||||||
#global rcrev .rc0
|
%global rcrev .rc0
|
||||||
|
|
||||||
Name: git
|
Name: git
|
||||||
Version: 2.31.1
|
Version: 2.32.0
|
||||||
Release: 3%{?rcrev}%{?dist}.1
|
Release: 0.0%{?rcrev}%{?dist}
|
||||||
Summary: Fast Version Control System
|
Summary: Fast Version Control System
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
URL: https://git-scm.com/
|
URL: https://git-scm.com/
|
||||||
@ -112,11 +112,6 @@ Source99: print-failed-test-output
|
|||||||
# https://bugzilla.redhat.com/490602
|
# https://bugzilla.redhat.com/490602
|
||||||
Patch0: git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch
|
Patch0: git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch
|
||||||
|
|
||||||
# https://bugzilla.redhat.com/1952030
|
|
||||||
# https://lore.kernel.org/git/D99DD9AD-54E5-4357-BA50-8B9CAE23084E@amazon.com/
|
|
||||||
# https://github.com/git/git/commit/75555676ad
|
|
||||||
Patch1: 0001-builtin-init-db-handle-bare-clones-when-core.bare-se.patch
|
|
||||||
|
|
||||||
%if %{with docs}
|
%if %{with docs}
|
||||||
# pod2man is needed to build Git.3pm
|
# pod2man is needed to build Git.3pm
|
||||||
BuildRequires: %{_bindir}/pod2man
|
BuildRequires: %{_bindir}/pod2man
|
||||||
@ -991,6 +986,9 @@ rmdir --ignore-fail-on-non-empty "$testdir"
|
|||||||
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.31.1-3.1
|
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.31.1-3.1
|
||||||
- Perl 5.34 rebuild
|
- Perl 5.34 rebuild
|
||||||
|
|
||||||
|
* Mon May 17 2021 Todd Zullinger <tmz@pobox.com> - 2.32.0-0.0.rc0
|
||||||
|
- update to 2.32.0-rc0
|
||||||
|
|
||||||
* Sun May 16 2021 Todd Zullinger <tmz@pobox.com>
|
* Sun May 16 2021 Todd Zullinger <tmz@pobox.com>
|
||||||
- clean up various dist conditionals
|
- clean up various dist conditionals
|
||||||
|
|
||||||
|
4
sources
4
sources
@ -1,2 +1,2 @@
|
|||||||
SHA512 (git-2.31.1.tar.xz) = 9aa334a3e8519700ff5d112153ec42677722980094caa9d22aa91afdb65166bd9a98fa445c0d327c428ebfa73bf4832e9b3836109a1d9319feafe3191cfd170e
|
SHA512 (git-2.32.0.rc0.tar.xz) = f75fda443e3640eff21c7be57726e08360141191ac9ffc2f456574e19e4c2cc20403fb32bf45034c03b519f1a385e152e603cf08c6da622f05593b2c4444206f
|
||||||
SHA512 (git-2.31.1.tar.sign) = 0a721876f9869d1dc9a43e7f83f8e63a3d8fa932ff2d2e69bb98f3e314e2e9a896c2171cb6a020d6c6e929fdf1af736dbeb3f25f93fb4d359a9aaa5b859069c3
|
SHA512 (git-2.32.0.rc0.tar.sign) = 3ab67290db6ac93f51156f811003c7940ac36bd27b5a296909746752e195569ebecaf45eaa848e47653328ab7726e150bbdf54d300175e9c66f2245570b04f2a
|
||||||
|
Loading…
Reference in New Issue
Block a user