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

Re: [PATCH 3/3] submodule--helper: add intern-git-dir function

From
BWBrandon Williams <bmwill@google.com>
Date
Nov 21, 2016, 21:56 UTC
Message-ID
<20161121215621.GB149321@google.com>
In-Reply-To
<20161121204146.13665-4-sbeller@google.com>
On 11/21, Stefan Beller wrote:
Show 47 quoted lines
> diff --git a/t/t7412-submodule-interngitdirs.sh b/t/t7412-submodule-interngitdirs.sh
> new file mode 100755
> index 0000000000..8938a4c8b7
> --- /dev/null
> +++ b/t/t7412-submodule-interngitdirs.sh
> @@ -0,0 +1,41 @@
> +#!/bin/sh
> +
> +test_description='Test submodule interngitdirs
> +
> +This test verifies that `git submodue interngitdirs` moves a submodules git
> +directory into the superproject.
> +'
> +
> +. ./test-lib.sh
> +
> +test_expect_success 'setup a real submodule' '
> +	git init sub1 &&
> +	test_commit -C sub1 first &&
> +	git submodule add ./sub1 &&
> +	test_tick &&
> +	git commit -m superproject
> +'
> +
> +test_expect_success 'intern the git dir' '
> +	git submodule interngitdirs &&
> +	test -f sub1/.git &&
> +	test -d .git/modules/sub1 &&
> +	# check that we did not break the repository:
> +	git status
> +'
> +
> +test_expect_success 'setup a gitlink with missing .gitmodules entry' '
> +	git init sub2 &&
> +	test_commit -C sub2 first &&
> +	git add sub2 &&
> +	git commit -m superproject
> +'
> +
> +test_expect_success 'intern the git dir fails for incomplete submodules' '
> +	test_must_fail git submodule interngitdirs &&
> +	# check that we did not break the repository:
> +	git status
> +'
> +
> +test_done
> +

Could we add a test which has nested submodules that need to be migrated? Hopfully its just as easy as adding the test :)

-- 
Brandon Williams
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 17 in “Introduce `submodule interngitdirs`”
  1. 0/3 Introduce `submodule interngitdirs`Stefan Beller, Nov 21, 2016
  2. 1/3 submodule: use absolute path for computing relative path connectingStefan Beller, Nov 21, 2016
  3. Junio C HamanoNov 21, 2016
  4. Stefan BellerNov 21, 2016
  5. Stefan BellerNov 22, 2016
  6. Junio C HamanoNov 22, 2016
  7. 2/3 test-lib-functions.sh: teach test_commit -C <dir>Stefan Beller, Nov 21, 2016
  8. Junio C HamanoNov 21, 2016
  9. 3/3 submodule--helper: add intern-git-dir functionStefan Beller, Nov 21, 2016
  10. Junio C HamanoNov 21, 2016
  11. Stefan BellerNov 22, 2016
  12. Junio C HamanoNov 22, 2016
  13. Stefan BellerNov 22, 2016
  14. Junio C HamanoNov 22, 2016
  15. Brandon WilliamsNov 21, 2016
  16. Junio C HamanoNov 21, 2016
  17. Stefan BellerNov 21, 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.