Re: [PATCH v4 01/16] Verify that `git pull --rebase` shows the helpful advice when failing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 25, 2016, 21:39 UTC
- Message-ID
- <xmqqk2g94cti.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <37e2f36e4f982261a741e327f1b534cb67b65149.1469187652.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> 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?
Show 14 quoted lines
> + 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.
Show 7 quoted lines
> + 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.
Show 8 quoted lines
> + 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.