Only treat .go files in ^vendor/ as generated

This commit is contained in:
Brandon Keepers
2016-02-18 19:57:34 -05:00
parent 3c5bcb434c
commit d46530989c
3 changed files with 6 additions and 2 deletions

View File

@@ -286,7 +286,9 @@ module Linguist
#
# Returns true or false.
def go_vendor?
!!name.match(/vendor\//)
return false unless extname == '.go'
!!name.match(/\Avendor\//)
end
# Internal: Is the blob part of Godeps/,

1
test/fixtures/go/food_vendor/candy.go vendored Normal file
View File

@@ -0,0 +1 @@
// empty file for testing that paths with vendor in them don't get ingored

View File

@@ -246,8 +246,9 @@ class TestBlob < Minitest::Test
assert sample_blob("node_modules/grunt/lib/grunt.js").generated?
# Go vendored dependencies
assert sample_blob("vendor/vendor.json").generated?
refute sample_blob("vendor/vendor.json").generated?
assert sample_blob("vendor/github.com/kr/s3/sign.go").generated?
refute fixture_blob("go/food_vendor/candy.go").generated?
# Godep saved dependencies
assert sample_blob("Godeps/Godeps.json").generated?