Sha256: 5a0dbb3061db9f1422424c2b6ece7e0c660856b097a24693a19c1415caffacf8

Contents?: true

Size: 1.53 KB

Versions: 11

Compression:

Stored size: 1.53 KB

Contents

# Disable git-lfs at checkout time, we run install --local and pull later 
Autobuild::Git.default_config['filter.lfs.smudge'] = 'git-lfs smudge --skip -- %f'
Autobuild::Git.default_config['filter.lfs.required'] = 'false'

module Autobuild
    Git.add_post_hook do |importer, package|
        lfs_dir = File.join(package.srcdir, '.git', 'lfs')
        if File.directory?(lfs_dir)
            importer.run_git(package, 'lfs', 'install', '--force', '--local', '--skip-smudge')

            includes = importer.options.fetch(:lfs_include, '')
            if includes.empty?
                begin
                    importer.run_git_bare(package, 'config', '--local', '--unset', 'lfs.fetchinclude')
                rescue SubcommandFailed => e
                    raise if e.status != 5
                end
            else
                importer.run_git_bare(package, 'config', '--local', 'lfs.fetchinclude', includes)
            end

            excludes = importer.options.fetch(:lfs_exclude, '')
            if excludes.empty?
                begin
                    importer.run_git_bare(package, 'config', '--local', '--unset', 'lfs.fetchexclude')
                rescue SubcommandFailed => e
                    raise if e.status != 5
                end
            else
                importer.run_git_bare(package, 'config', '--local', 'lfs.fetchexclude', excludes)
            end

            if importer.options[:lfs] != false
                importer.run_git(package, 'lfs', 'pull', importer.remote_name)
            end
        end
    end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
autobuild-1.12.1 lib/autobuild/import/git-lfs.rb
autobuild-1.12.0 lib/autobuild/import/git-lfs.rb
autobuild-1.11.2 lib/autobuild/import/git-lfs.rb
autobuild-1.11.1 lib/autobuild/import/git-lfs.rb
autobuild-1.11.0 lib/autobuild/import/git-lfs.rb
autobuild-1.11.0.rc1 lib/autobuild/import/git-lfs.rb
autobuild-1.10.1 lib/autobuild/import/git-lfs.rb
autobuild-1.10.0 lib/autobuild/import/git-lfs.rb
autobuild-1.10.0.rc22 lib/autobuild/import/git-lfs.rb
autobuild-1.10.0.rc21 lib/autobuild/import/git-lfs.rb
autobuild-1.10.0.rc20 lib/autobuild/import/git-lfs.rb