This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1129,6 +1129,34 @@ func (s *WorktreeSuite) TestIgnored(c *C) {
11291129 c .Assert (file .Worktree , Equals , Untracked )
11301130}
11311131
1132+ func (s * WorktreeSuite ) TestExcludedNoGitignore (c * C ) {
1133+ f := fixtures .ByTag ("empty" ).One ()
1134+ r := s .NewRepository (f )
1135+
1136+ fs := memfs .New ()
1137+ w := & Worktree {
1138+ r : r ,
1139+ Filesystem : fs ,
1140+ }
1141+
1142+ _ , err := fs .Open (".gitignore" )
1143+ c .Assert (err , Equals , os .ErrNotExist )
1144+
1145+ w .Excludes = make ([]gitignore.Pattern , 0 )
1146+ w .Excludes = append (w .Excludes , gitignore .ParsePattern ("foo" , nil ))
1147+
1148+ err = util .WriteFile (w .Filesystem , "foo" , []byte ("FOO" ), 0755 )
1149+ c .Assert (err , IsNil )
1150+
1151+ status , err := w .Status ()
1152+ c .Assert (err , IsNil )
1153+ c .Assert (status , HasLen , 0 )
1154+
1155+ file := status .File ("foo" )
1156+ c .Assert (file .Staging , Equals , Untracked )
1157+ c .Assert (file .Worktree , Equals , Untracked )
1158+ }
1159+
11321160func (s * WorktreeSuite ) TestAddModified (c * C ) {
11331161 fs := memfs .New ()
11341162 w := & Worktree {
You can’t perform that action at this time.
0 commit comments