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

Re: [PATCH 2/1] t9300: test verification of renamed paths

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 4, 2024, 00:15 UTC
Message-ID
<xmqqed2o717j.fsf@gitster.g>
In-Reply-To
<20241203210652.GA1413195@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
>> I would say yes, but since this patch too has made it to next and is
>> marked for master, I'm kinda tempted to just leave it as-is...
>
> Is is tempting. :) I wrote this up, though, which can just go on top (of
> en/fast-import-verify-path).
Thanks, queued.
Show 39 quoted lines
> -- >8 --
> Subject: [PATCH] t9300: test verification of renamed paths
>
> Commit da91a90c2f (fast-import: disallow more path components,
> 2024-11-30) added two separate verify_path() calls (one for
> added/modified files, and one for renames/copies). But our tests only
> exercise the first one. Let's protect ourselves against regressions by
> tweaking one of the tests to rename into the bad path. There are
> adjacent tests that will stay as additions, so now both calls are
> covered.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  t/t9300-fast-import.sh | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
> index e2b1db6bc2..fd01a2353c 100755
> --- a/t/t9300-fast-import.sh
> +++ b/t/t9300-fast-import.sh
> @@ -553,9 +553,16 @@ test_expect_success 'B: fail on invalid file path of .' '
>  	commit refs/heads/badpath
>  	committer Name <email> $GIT_COMMITTER_DATE
>  	data <<COMMIT
> -	Commit Message
> +	Good path
> +	COMMIT
> +	M 100644 :1 ok-path
> +
> +	commit refs/heads/badpath
> +	committer Name <email> $GIT_COMMITTER_DATE
> +	data <<COMMIT
> +	Bad path
>  	COMMIT
> -	M 100644 :1 ./invalid-path
> +	R ok-path ./invalid-path
>  	INPUT_END
>  
>  	test_when_finished "git update-ref -d refs/heads/badpath" &&
Previous: Elijah NewrenNext: Junio C Hamano
Message 9 of 11 in “fast-import: disallow more path components”
  1. fast-import: disallow more path componentsElijah Newren via GitGitGadget, Nov 27, 2024
  2. Junio C HamanoNov 28, 2024
  3. Jeff KingNov 28, 2024
  4. fast-import: disallow more path componentsElijah Newren via GitGitGadget, Nov 30, 2024
  5. Jeff KingDec 1, 2024
  6. Elijah NewrenDec 3, 2024
  7. 2/1 t9300: test verification of renamed pathsJeff King, Dec 3, 2024
  8. Elijah NewrenDec 3, 2024
  9. Junio C HamanoDec 4, 2024
  10. Junio C HamanoDec 3, 2024
  11. Junio C HamanoDec 2, 2024

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.