Sha256: 8cbeb6566e185f8bdeef57fa53afe96e8da869c89f9397eb2413f57ec5b6ea75

Contents?: true

Size: 694 Bytes

Versions: 5

Compression:

Stored size: 694 Bytes

Contents

module Overcommit::Hook::PrePush
  # Invokes Git LFS command that uploads files tracked by Git LFS to the LFS storage
  #
  # @see https://git-lfs.github.com/
  class GitLfs < Base
    def run
      unless in_path?('git-lfs')
        return :warn, 'This repository is configured for Git LFS but \'git-lfs\' ' \
        "was not found on your path.\nIf you no longer wish to use Git LFS, " \
        'disable this hook by removing or setting \'enabled: false\' for GitLFS ' \
        'hook in your .overcommit.yml file'
      end

      result = execute(['git', 'lfs', 'pre-push', remote_name, remote_url])
      return :fail, result.stderr unless result.success?

      :pass
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
overcommit-0.42.0 lib/overcommit/hook/pre_push/git_lfs.rb
overcommit-0.41.0 lib/overcommit/hook/pre_push/git_lfs.rb
overcommit-0.40.0 lib/overcommit/hook/pre_push/git_lfs.rb
overcommit-0.39.1 lib/overcommit/hook/pre_push/git_lfs.rb
overcommit-0.39.0 lib/overcommit/hook/pre_push/git_lfs.rb