git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Ben Avison <bavison@riscosopen.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] clone: add `--remote-submodules` flag
Date: Mon, 13 May 2019 23:12:17 +0200	[thread overview]
Message-ID: <87sgtivz2m.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <20190513175903.126079-1-bavison@riscosopen.org>


On Mon, May 13 2019, Ben Avison wrote:

> @@ -792,6 +795,11 @@ static int checkout(int submodule_progress)
>  		if (option_verbosity < 0)
>  			argv_array_push(&args, "--quiet");
>
> +		if (option_remote_submodules == 1) {

I see you copied this from code above the context, but to check a bool
variable just use "if (var)" not "if (var == 1)".

> +test_expect_success 'check the default is --no-remote-submodules' '
> +	test_when_finished "rm -rf super_clone" &&
> +	git clone --recurse-submodules --no-remote-submodules "file://$pwd/." super_clone &&
> +	(
> +		cd super_clone/sub &&
> +		git diff --exit-code sub_when_added_to_super
> +	)
> +'

This isn't testing the default, it just tests --no-remote-submodules,
i.e. if you change the "static int" assignment to "1" (to make this new
option the default) all these tests will still pass.

Just fixing that means we finally test for this (the entire test suite
would pass before with this on, showing a concerning lack of test
coverage in the submodule tests...), but with just
s/--no-remote-submodules // here we'll test for it.

You might want to have another test to explicitly check what happens
with --no-remote-submodules, but I don't think it's worth the effort, at
that point you're just testing the getopt machinery.

  reply	other threads:[~2019-05-13 21:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13 17:59 [PATCH] clone: add `--remote-submodules` flag Ben Avison
2019-05-13 21:12 ` Ævar Arnfjörð Bjarmason [this message]
2019-05-14 18:38   ` Ben Avison
2019-05-19 14:26   ` [PATCH v2] " Ben Avison
2019-05-16 11:31 ` [PATCH] " Duy Nguyen
2019-05-16 17:50   ` Ben Avison
2019-05-18 11:40     ` Duy Nguyen

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=87sgtivz2m.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=bavison@riscosopen.org \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).