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

Re: [PATCH 1/4] t7800-difftool: cleanup temporary repositories used by tests

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 20, 2021, 18:28 UTC
Message-ID
<xmqqv92vayq2.fsf@gitster.g>
In-Reply-To
<20210919015729.98323-1-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 17 quoted lines
> The "dirlinks" and "growing" repositories should not outlive the
> tests that use them.
>
> Signed-off-by: David Aguilar <davvid@gmail.com>
> ---
>  t/t7800-difftool.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
> index a173f564bc..a923f193da 100755
> --- a/t/t7800-difftool.sh
> +++ b/t/t7800-difftool.sh
> @@ -414,6 +414,7 @@ test_expect_success 'setup change in subdirectory' '
>  test_expect_success 'difftool -d with growing paths' '
>  	a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
>  	git init growing &&
> +	test_when_finished rm -rf growing &&

If "git init" fails after it created the directory, it will be left behind because test_when_finished hasn't been called yet. The same problem exists in the other hunk. Moving it above "git init" may trigger "rm -rf X" where X does not exist yet, but that is what you are giving the 'f'orce option there for.

Not a huge deal and no need to resend only to fix them alone, though.

Show 11 quoted lines
>  	(
>  		cd growing &&
>  		echo "test -f \"\$2/b\"" | write_script .git/test-for-b.sh &&
> @@ -646,6 +647,7 @@ test_expect_success 'difftool properly honors gitlink and core.worktree' '
>  test_expect_success SYMLINKS 'difftool --dir-diff symlinked directories' '
>  	test_when_finished git reset --hard &&
>  	git init dirlinks &&
> +	test_when_finished rm -rf dirlinks &&
>  	(
>  		cd dirlinks &&
>  		git config diff.tool checktrees &&
Previous: Ævar Arnfjörð Bjarmason
Message 16 of 16 in “t7800-difftool: cleanup temporary repositories used by tests”
  1. 1/4 t7800-difftool: cleanup temporary repositories used by testsDavid Aguilar, Sep 19, 2021
  2. 2/4 difftool: add a missing space to the run_dir_diff() commentsDavid Aguilar, Sep 19, 2021
  3. 3/4 difftool: use a strbuf to create the tmpdir pathDavid Aguilar, Sep 19, 2021
  4. Jeff KingSep 19, 2021
  5. 3/4 difftool: use a strbuf to create the tmpdir pathDavid Aguilar, Sep 19, 2021
  6. Junio C HamanoSep 20, 2021
  7. Johannes SixtSep 19, 2021
  8. David AguilarSep 19, 2021
  9. Johannes SixtSep 19, 2021
  10. David AguilarSep 19, 2021
  11. Johannes SixtSep 19, 2021
  12. 4/4 difftool: fix symlink-file writing in dir-diff modeDavid Aguilar, Sep 19, 2021
  13. 4/4 difftool: fix symlink-file writing in dir-diff modeDavid Aguilar, Sep 19, 2021
  14. 4/4 difftool: fix symlink-file writing in dir-diff modeDavid Aguilar, Sep 19, 2021
  15. Ævar Arnfjörð BjarmasonSep 19, 2021
  16. Junio C HamanoSep 20, 2021

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.