From: SZEDER Gábor Date: Thu, 13 Jun 2019 15:19:18 GMT Subject: Re: [PATCH v3 11/16] t: add tests for restore Message-ID: <20190613151918.GB31952@szeder.dev> In-Reply-To: <20190425094600.15673-12-pclouds@gmail.com> On Thu, Apr 25, 2019 at 04:45:55PM +0700, Nguyễn Thái Ngọc Duy wrote: > diff --git a/t/t2070-restore.sh b/t/t2070-restore.sh > new file mode 100755 > index 0000000000..73ea13ede9 > --- /dev/null > +++ b/t/t2070-restore.sh > +test_expect_success 'restore --ignore-unmerged ignores unmerged entries' ' > + git init unmerged && > + ( > + cd unmerged && > + echo one >unmerged && > + echo one >common && > + git add unmerged common && > + git commit -m common && > + git switch -c first && > + echo first >unmerged && > + git commit -am first && > + git switch -c second master && > + echo second >unmerged && > + git commit -am second && > + test_must_fail git merge first && > + > + echo dirty >>common && > + test_must_fail git restore . && > + > + git restore --ignore-unmerged --quiet . >output 2>&1 && > + git diff common >diff-output && > + : >empty && > + test_cmp empty output && > + test_cmp empty diff-output Please use 'test_must_be_empty'. (and perhaps 'git diff --exit-code common'? dunno)