mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Mode must always be a String
This commit is contained in:
		@@ -34,9 +34,9 @@ module Linguist
 | 
			
		||||
 | 
			
		||||
    # Public: Read file permissions
 | 
			
		||||
    #
 | 
			
		||||
    # Returns an Int like 0100644
 | 
			
		||||
    # Returns a String like '0100644'
 | 
			
		||||
    def mode
 | 
			
		||||
      File.stat(@path).mode
 | 
			
		||||
      File.stat(@path).mode.to_s(8)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    # Public: Read file contents.
 | 
			
		||||
 
 | 
			
		||||
@@ -99,7 +99,7 @@ module Linguist
 | 
			
		||||
      # A bit of an elegant hack. If the file is executable but extensionless,
 | 
			
		||||
      # append a "magic" extension so it can be classified with other
 | 
			
		||||
      # languages that have shebang scripts.
 | 
			
		||||
      if File.extname(name).empty? && blob.mode && (blob.mode & 05) == 05
 | 
			
		||||
      if File.extname(name).empty? && blob.mode && (blob.mode.to_i(8) & 05) == 05
 | 
			
		||||
        name += ".script!"
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -81,7 +81,8 @@ module Linguist
 | 
			
		||||
        next if delta.binary
 | 
			
		||||
 | 
			
		||||
        if [:added, :modified].include? delta.status
 | 
			
		||||
          blob = Linguist::LazyBlob.new(repository, delta.new_file[:oid], new, delta.new_file[:mode])
 | 
			
		||||
          mode = delta.new_file[:mode].to_s(8)
 | 
			
		||||
          blob = Linguist::LazyBlob.new(repository, delta.new_file[:oid], new, mode)
 | 
			
		||||
 | 
			
		||||
          # Skip vendored or generated blobs
 | 
			
		||||
          next if blob.vendored? || blob.generated? || blob.language.nil?
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,3 @@
 | 
			
		||||
module Linguist
 | 
			
		||||
  VERSION = "2.13.0.github2"
 | 
			
		||||
  VERSION = "2.13.0.github3"
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user