Re: [PATCH v4 04/12] merge-tree: implement real merges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 12 2022, Elijah Newren via GitGitGadget wrote:

> +# This test is ort-specific
> +if test "${GIT_TEST_MERGE_ALGORITHM}" != "ort"

Nit: Needless braces, left over from an earlier version where you used ${VAR:+...} ?

> +test_expect_success 'Clean merge' '
> +	git merge-tree --write-tree side1 side3 >RESULT &&
> +	q_to_tab <<-EOF >expect &&
> +	100644 blob $(git rev-parse side1:greeting)Qgreeting
> +	100644 blob $(git rev-parse side1:numbers)Qsequence
> +	100644 blob $(git rev-parse side1:whatever)Qwhatever
> +	EOF
> +
> +	git ls-tree $(cat RESULT) >actual &&

Nit: to avoid the "cat":

    oid=$(git merge-tree ...) &&
    [...]
    git ls-tree $oid [...]

> +	test_cmp expect actual
> +'
> +
> +test_expect_success 'Content merge and a few conflicts' '
> +	git checkout side1^0 &&
> +	test_must_fail git merge side2 &&
> +	expected_tree=$(cat .git/AUTO_MERGE) &&

Let's do "git rev-parse AUTO_MERGE", to avoid needing REFFILES here.

> [...]
> +	# greeting should have a merge conflict
> +	git show ${expected_tree}:greeting >tmp &&
> +	cat tmp | sed -e s/HEAD/side1/ >expect &&

Nit: More needless "cat", can just be: "sed ... <tmp >expect".



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux