Jakub Narebski <jnareb@xxxxxxxxx> wrote: > > +test_expect_success \ > > +'preparation' ' > > +git config core.filemode false && > > +touch foo && > > +git add foo && > > +git update-index --chmod=+x foo && > > +git commit -m "Create"' > > The suggested way of coding in test script looks like the following: > > +test_expect_success 'preparation' ' > + git config core.filemode false && > + >foo && > + git add foo && > + git update-index --chmod=+x foo && > + git commit -m "Create" > +' OK, will use that style next time, thanks. I copied the style from t2102... > BTW. does it matter that 'foo' is empty? No, it doesn't make a difference. > [...] > > +test_expect_failure \ > > +'check that filemode is still 100755' ' > > +case "`git ls-files --stage --cached -- foo`" in > > +"100755 "*foo) echo pass;; > > +*) echo fail; git ls-files --stage --cached -- foo; (exit 1);; > > +esac' > > Wouldn't it be better to simply prepare expected output (perhaps with > stubs for hashes), and compare actual with expected output? Maybe; again, I just copied that from t2102. (That's also why I felt uncomfortable putting that copyright notice at the top of my files...) > Also, weren't you able to use test_tick, test_commit, test_merge > functions from test-lib.sh? I used test_commit where possible; for the initial commit I couldn't. As for test_merge and test_tick, I could have used them, yes; what's the benefit though? -- Stefan Haller Berlin, Germany http://www.haller-berlin.de/ -- 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