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

Re: [PATCH v3] checkout: avoid unnecessary match_pathspec calls

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 28, 2013, 22:32 UTC
Message-ID
<7vd2ujrw90.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1364363901-17815-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 14 quoted lines
> diff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh
> index 56090d2..5e01d58 100755
> --- a/t/t2022-checkout-paths.sh
> +++ b/t/t2022-checkout-paths.sh
> @@ -39,4 +39,25 @@ test_expect_success 'checking out paths out of a tree does not clobber unrelated
>  	test_cmp expect.next2 dir/next2
>  '
>  
> +test_expect_success 'do not touch unmerged entries matching $path but not in $tree' '
> +	git checkout next &&
> +	git reset --hard &&
> +
> +	cat dir/common >expect.common &&
> +	EMPTY_SHA1=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 &&
	EMPTY_SHA1=$(git hash-object -w --stdin </dev/null)
Show 6 quoted lines
> +	git rm dir/next0 &&
> +	cat >expect.next0<<EOF &&
> +100644 $EMPTY_SHA1 1	dir/next0
> +100644 $EMPTY_SHA1 2	dir/next0
> +EOF
> +	git update-index --index-info < expect.next0 &&
	cat >expect.next0 <<-EOF &&
        100644 $EMPTY_SHA1 1 dir/next0
        100644 $EMPTY_SHA1 2 dir/next0
	EOF
	git update-index --index-info <expect.next0 &&
Show 8 quoted lines
> +
> +	git checkout master dir &&
> +
> +	test_cmp expect.common dir/common &&
> +	test_path_is_file dir/master &&
> +	git diff --exit-code master dir/master &&
> +	git ls-files -s dir/next0 >actual.next0
> +'
... and actual.next0 is checked against what?
Ending this test with
	git ls-files -s dir/next0 >actual.next0 &&
	test_cmp expect.next0 actual.next0
would be sufficient, methinks.
Will replace v2 with the above fixups.  Thanks.
> +
>  test_done
Previous: Nguyễn Thái Ngọc Duy
Message 7 of 7 in “checkout: avoid unncessary match_pathspec calls”
  1. checkout: avoid unncessary match_pathspec callsNguyễn Thái Ngọc Duy, Mar 23, 2013
  2. Eric SunshineMar 24, 2013
  3. Junio C HamanoMar 24, 2013
  4. checkout: avoid unnecessary match_pathspec callsNguyễn Thái Ngọc Duy, Mar 24, 2013
  5. Junio C HamanoMar 25, 2013
  6. checkout: avoid unnecessary match_pathspec callsNguyễn Thái Ngọc Duy, Mar 27, 2013
  7. Junio C HamanoMar 28, 2013

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.