git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv2] clone: add `--shallow-submodules` flag

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 26, 2016, 17:46 UTC
Message-ID
<xmqqtwiogt4y.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1461633147-23131-1-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
>  I did not rebase this on 85705cfb (Merge branch 'ss/clone-depth-single-doc',
>  2016-01-20) or later, but worked on it with the base unchanged.
Thanks, will replace.
Show 33 quoted lines
> diff --git a/t/t5614-clone-submodules.sh b/t/t5614-clone-submodules.sh
> new file mode 100755
> index 0000000..62044c5
> --- /dev/null
> +++ b/t/t5614-clone-submodules.sh
> @@ -0,0 +1,85 @@
> +#!/bin/sh
> +
> +test_description='Test shallow cloning of repos with submodules'
> +
> +. ./test-lib.sh
> +
> +pwd=$(pwd)
> +
> +test_expect_success 'setup' '
> +	git checkout -b master &&
> +	test_commit commit1 &&
> +	test_commit commit2 &&
> +	mkdir sub &&
> +	(
> +		cd sub &&
> +		git init &&
> +		test_commit subcommit1 &&
> +		test_commit subcommit2 &&
> +		test_commit subcommit3
> +	) &&
> +	git submodule add "file://$pwd/sub" sub &&
> +	git commit -m "add submodule"
> +'
> +
> +test_expect_success 'nonshallow clone implies nonshallow submodule' '
> +	test_when_finished "rm -rf super_clone" &&
> +	git clone --recurse-submodules "file://$pwd/." super_clone &&

All of these "$path/." made me wonder one thing. I know these URLs that ends with slash-dot ought to work, but shouldn't they work without them, too? The "consistency" in this test that ends anything that would have ended with "$pwd" with "$pwd/." somewhat bothered me.

Previous: Stefan BellerNext: Stefan Beller
Message 2 of 3 in “[PATCHv2] clone: add `--shallow-submodules` flag”
  1. Stefan BellerApr 26, 2016
  2. Junio C HamanoApr 26, 2016
  3. Stefan BellerApr 26, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.