Re: [PATCH v4 01/16] Verify that `git pull --rebase` shows the helpful advice when failing

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

 



Johannes Schindelin <johannes.schindelin@xxxxxx> writes:

> +test_expect_success '--rebase with conflicts shows advice' '
> +	test_when_finished "git rebase --abort; git checkout -f to-rebase" &&
> +	git checkout -b seq &&
> +	printf "1\\n2\\n3\\n4\\n5\\n" >seq.txt &&

Make this more readble by using test-write-lines, perhaps?

> +	git add seq.txt &&
> +	test_tick &&
> +	git commit -m "Add seq.txt" &&
> +	printf "6\\n" >>seq.txt &&
> +	test_tick &&
> +	git commit -m "Append to seq.txt" seq.txt &&
> +	git checkout -b with-conflicts HEAD^ &&
> +	printf "conflicting\\n" >>seq.txt &&
> +	test_tick &&
> +	git commit -m "Create conflict" seq.txt &&
> +	test_must_fail git pull --rebase . seq 2>err >out &&
> +	grep "When you have resolved this problem" out
> +'
> +test_expect_success 'failed --rebase shows advice' '

Need a blank line before this one.

> +	test_when_finished "git rebase --abort; git checkout -f to-rebase" &&
> +	git checkout -b diverging &&
> +	test_commit attributes .gitattributes "* text=auto" attrs &&
> +	sha1="$(printf "1\\r\\n" | git hash-object -w --stdin)" &&
> +	git update-index --cacheinfo 0644 $sha1 file &&
> +	git commit -m v1-with-cr &&
> +	git checkout -f -b fails-to-rebase HEAD^ &&

It is unclear what the "-f" is for; is it attempting to clean up a
potential mess previous steps might have left?  We didn't have it in
the previous test above.

> +	test_commit v2-without-cr file "2" file2-lf &&
> +	test_must_fail git pull --rebase . diverging 2>err >out &&
> +	grep "When you have resolved this problem" out
> +'
> +
>  test_expect_success '--rebase fails with multiple branches' '
>  	git reset --hard before-rebase &&
>  	test_must_fail git pull --rebase . copy master 2>err &&

Not worth a reroll but after this series settles we would probably
want to address some of the above up with a follow-up clean-up patch.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]