git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3] checkout: avoid unnecessary match_pathspec calls
Date: Thu, 28 Mar 2013 15:32:27 -0700	[thread overview]
Message-ID: <7vd2ujrw90.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 1364363901-17815-1-git-send-email-pclouds@gmail.com

Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:

> 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)

> +	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 &&

> +
> +	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

      reply	other threads:[~2013-03-28 22:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 10:55 [PATCH] checkout: avoid unncessary match_pathspec calls Nguyễn Thái Ngọc Duy
2013-03-24  2:45 ` Eric Sunshine
2013-03-24  6:47 ` Junio C Hamano
2013-03-24 12:55   ` [PATCH v2] checkout: avoid unnecessary " Nguyễn Thái Ngọc Duy
2013-03-25 16:26     ` Junio C Hamano
2013-03-27  5:58       ` [PATCH v3] " Nguyễn Thái Ngọc Duy
2013-03-28 22:32         ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vd2ujrw90.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).