File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ def filter_by_cc_includes
46
46
47
47
def ignored_files
48
48
Tempfile . open ( ".cc_gitignore" ) do |tmp |
49
- tmp . write ( File . read ( ".gitignore" ) ) if File . exist ?( ".gitignore" )
49
+ tmp . write ( File . read ( ".gitignore" ) ) if File . file ?( ".gitignore" )
50
50
tmp << @cc_exclude_paths . join ( "\n " )
51
51
tmp . close
52
52
tracked_and_ignored = `git ls-files -zi -X #{ tmp . path } ` . split ( "\0 " )
Original file line number Diff line number Diff line change @@ -243,5 +243,15 @@ module CC::Analyzer
243
243
result . include? ( "untrackable.rb" ) . must_equal ( false )
244
244
end
245
245
end
246
+
247
+ describe "when .gitignore is a directory" do
248
+ before do
249
+ FileUtils . mkdir ( ".gitignore" )
250
+ end
251
+
252
+ it "skips it entirely" do
253
+ result . include? ( "./" ) . must_equal ( true )
254
+ end
255
+ end
246
256
end
247
257
end
You can’t perform that action at this time.
0 commit comments