From 730be65514cac409073ad41faf3599889a3d7ca7 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 28 Feb 2015 16:08:16 +0100 Subject: [PATCH] Ignore symlinks in repository statistics --- lib/linguist/repository.rb | 4 +- test/fixtures/SVG/alg_schema.link.svg | 1 + test/fixtures/SVG/alg_schema.svg | 269 ++++++++++++++++++++++++++ 3 files changed, 272 insertions(+), 2 deletions(-) create mode 120000 test/fixtures/SVG/alg_schema.link.svg create mode 100644 test/fixtures/SVG/alg_schema.svg diff --git a/lib/linguist/repository.rb b/lib/linguist/repository.rb index 895a3754..b45b825d 100644 --- a/lib/linguist/repository.rb +++ b/lib/linguist/repository.rb @@ -150,9 +150,9 @@ module Linguist next if delta.binary if [:added, :modified].include? delta.status - # Skip submodules + # Skip submodules and symlinks mode = delta.new_file[:mode] - next if (mode & 040000) != 0 + next if (mode & 0040000) != 0 || (mode & 0120000) != 0 blob = Linguist::LazyBlob.new(repository, delta.new_file[:oid], new, mode.to_s(8)) diff --git a/test/fixtures/SVG/alg_schema.link.svg b/test/fixtures/SVG/alg_schema.link.svg new file mode 120000 index 00000000..2f2cb2e4 --- /dev/null +++ b/test/fixtures/SVG/alg_schema.link.svg @@ -0,0 +1 @@ +alg_schema.svg \ No newline at end of file diff --git a/test/fixtures/SVG/alg_schema.svg b/test/fixtures/SVG/alg_schema.svg new file mode 100644 index 00000000..cd709914 --- /dev/null +++ b/test/fixtures/SVG/alg_schema.svg @@ -0,0 +1,269 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + Sequence KEY256 bits + + + + + Salt96 bits Counter32 bits + + + + + AES Cipher + + + + + + + Secure random data128 bits + + + Division by alphabet lengthrepeated passcode-length times. + + + + Passcode2-16 characters + + + +