Re: [PATCH v2 05/12] t5520: test --rebase failure on unborn branch with index
From: Paul Tan <hidden>
Date: 2016-06-15 23:04:41
Hi, On Fri, May 8, 2015 at 12:32 AM, Stefan Beller [off-list ref] wrote:
On Thu, May 7, 2015 at 1:44 AM, Paul Tan [off-list ref] wrote:quoted
+test_expect_success 'pull --rebase fails on unborn branch with staged changes' ' + test_when_finished "rm -rf empty_repo2" && + git init empty_repo2 && + ( + cd empty_repo2 && + echo staged-file >staged-file && + git add staged-file && + test "$(git ls-files)" = staged-file &&I think usually people use git ls-files >actual echo staged-file >expected && # you have this already in your 2nd # line in the paragraph test_cmp staged-file actual to make debugging easier as you can inspect the files (actual, expected) after the test has failed. Personally I don't mind the difference as when it comes to debugging using the test suite I haven't found the silver bullet yet.
Ehh, but using test_cmp will litter the test with lots of "echo X
expected" lines which I find quite distracting.
Just thinking aloud, but it would be great if there was a function to compare a string and a file, or a string and a string. But yeah, I guess if the patches are verified to be correct, then I should change these comparisons to use test_cmp. Thanks, Paul