All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Kaestle <peter.kaestle@nokia.com>
To: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Stefan Beller <sbeller@google.com>
Cc: peter.kaestle@nokia.com
Subject: [RFC 2/2] Revert "submodule.c: fetch in submodules git directory instead of in worktree"
Date: Mon,  9 Nov 2020 09:33:49 +0100	[thread overview]
Message-ID: <1604910829-49109-3-git-send-email-peter.kaestle@nokia.com> (raw)
In-Reply-To: <1604910829-49109-1-git-send-email-peter.kaestle@nokia.com>

This reverts commit a62387b3fc9f5aeeb04a2db278121d33a9caafa7 and sets
the "fetching a superproject containing an uninitialized sub/sub
project" testcase to expect success.

Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com>
---
 submodule.c                 | 14 ++++----------
 t/t5526-fetch-submodules.sh |  2 +-
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/submodule.c b/submodule.c
index b3bb59f..eef5204e 100644
--- a/submodule.c
+++ b/submodule.c
@@ -499,12 +499,6 @@ void prepare_submodule_repo_env(struct strvec *out)
 		     DEFAULT_GIT_DIR_ENVIRONMENT);
 }
 
-static void prepare_submodule_repo_env_in_gitdir(struct strvec *out)
-{
-	prepare_submodule_repo_env_no_git_dir(out);
-	strvec_pushf(out, "%s=.", GIT_DIR_ENVIRONMENT);
-}
-
 /*
  * Initialize a repository struct for a submodule based on the provided 'path'.
  *
@@ -1455,8 +1449,8 @@ static int get_next_submodule(struct child_process *cp,
 		if (task->repo) {
 			struct strbuf submodule_prefix = STRBUF_INIT;
 			child_process_init(cp);
-			cp->dir = task->repo->gitdir;
-			prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+			cp->dir = task->repo->worktree;
+			prepare_submodule_repo_env(&cp->env_array);
 			cp->git_cmd = 1;
 			if (!spf->quiet)
 				strbuf_addf(err, _("Fetching submodule %s%s\n"),
@@ -1505,9 +1499,9 @@ static int get_next_submodule(struct child_process *cp,
 			    spf->prefix, task->sub->path);
 
 		child_process_init(cp);
-		prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+		prepare_submodule_repo_env(&cp->env_array);
 		cp->git_cmd = 1;
-		cp->dir = task->repo->gitdir;
+		cp->dir = task->repo->worktree;
 
 		strvec_init(&cp->args);
 		strvec_pushv(&cp->args, spf->args.v);
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index 9fbd481..236e26a 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -729,7 +729,7 @@ add_commit_push()
 	git -C "$dir" push
 }
 
-test_expect_failure 'fetching a superproject containing an uninitialized sub/sub project' '
+test_expect_success 'fetching a superproject containing an uninitialized sub/sub project' '
 	# does not depend on any previous test setups
 
 	for repo in outer middle inner
-- 
2.6.2


  parent reply	other threads:[~2020-11-09  8:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 14:23 [REGRESSION FIX 0/2] Handling regression introduced by a62387b Peter Kaestle
2020-11-03 14:23 ` [REGRESSION FIX 1/2] submodules: test for fetch of non-init subsub-repo Peter Kaestle
2020-11-03 14:23 ` [REGRESSION FIX 2/2] Revert "submodule.c: fetch in submodules git directory instead of in worktree" Peter Kaestle
2020-11-09  8:33 ` [RFC 0/2] Handling regression introduced by a62387b Peter Kaestle
2020-11-09  8:33   ` [RFC 1/2] submodules: test for fetch of non-init subsub-repo Peter Kaestle
2020-11-09 17:52     ` Junio C Hamano
2020-11-11 12:45       ` Peter Kästle
2020-11-11 17:22         ` Philip Oakley
2020-11-12 16:00           ` [RFCv2] submodules: fix of regression on fetching " Peter Kaestle
2020-11-11 17:35       ` [RFC 1/2] submodules: test for fetch " Philippe Blain
2020-11-11 19:27         ` Junio C Hamano
2020-11-11 19:24     ` Philippe Blain
2020-11-09  8:33   ` Peter Kaestle [this message]
2020-11-10 15:08     ` [RFC 2/2] Revert "submodule.c: fetch in submodules git directory instead of in worktree" Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1604910829-49109-3-git-send-email-peter.kaestle@nokia.com \
    --to=peter.kaestle@nokia.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.