From: Eric Sunshine Date: Sun, 15 Mar 2015 18:18:15 GMT Subject: Re: [PATCH 3/3] t3700-add: added test for --exclude option Message-ID: In-Reply-To: <1426427437-23370-1-git-send-email-kuleshovmail@gmail.com> On Sun, Mar 15, 2015 at 9:50 AM, Alexander Kuleshov wrote: > t3700-add: added test for --exclude option Write in imperative mood: s/added/add/ > Signed-off-by: Alexander Kuleshov > --- > diff --git a/t/t3700-add.sh b/t/t3700-add.sh > index f7ff1f5..c52a5d0 100755 > --- a/t/t3700-add.sh > +++ b/t/t3700-add.sh > @@ -81,6 +81,13 @@ test_expect_success '.gitignore is honored' ' > ! (git ls-files | grep "\\.ig") > ' > > +test_expect_success 'Test that "git add --exclude" works' ' > + touch foo && > + touch bar && Expanding slightly on what Torsten said: Use 'touch' when the timestamp of the file is significant to the test; otherwise, just use ">foo". > + git add --exclude="bar" . && > + ! (git ls-files | grep bar) For completeness, don't you also want to test that "foo" _does_ appear in the git-ls-files output? > +' > + > test_expect_success 'error out when attempting to add ignored ones without -f' ' > test_must_fail git add a.?? && > ! (git ls-files | grep "\\.ig") > -- > 2.3.3.472.g20ceeac