autobuild 1.10.0.rc19 → 1.10.0.rc20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd8fef579b829167296d2e6b50249e68aa7cc811
4
- data.tar.gz: 1d77007e89b07d5be9a72b04bd6e16938bf920d3
3
+ metadata.gz: ebb72391557598f96bcf4d7b8bb34e10ae44ee6e
4
+ data.tar.gz: 637a0ae6c9e1a70b079397985aa386d5a80c7353
5
5
  SHA512:
6
- metadata.gz: 37c2ef54fca05b19d03a2a9e2f4e880de83d51767645fcf334a507746b61042ebb9b6d79224a8e19e4b8b1dfb31e00d1b61c29e9203e46d672634aff70eed364
7
- data.tar.gz: e4278ec9b00fe793a23aea395423cdcf0b1c6a538eb91183b05f6719de186532ce89f3bdaa03c025cdba6c520080013017c3ceb835756c6a6888083e96becf73
6
+ metadata.gz: b862462f126b226fbb2326c418330578bf8454a46b64ad92a33bc030bf908120e536c8f635be79fbe9e960c267b4f7323558497b5809bce1404534c7d0fba68b
7
+ data.tar.gz: ce5ce2cab50ec932500ca3f684df8676170d6aeea62d4810e98cb52d862c3e2c5007920901f3169fd99c320b83ee3a07226e0ee0b64acbb2415183512ed21d10
@@ -1,15 +1,38 @@
1
1
  # Disable git-lfs at checkout time, we run install --local and pull later
2
- Autobuild::Git.default_config['filter.lfs.smudge'] = ''
2
+ Autobuild::Git.default_config['filter.lfs.smudge'] = 'git-lfs smudge --skip -- %f'
3
3
  Autobuild::Git.default_config['filter.lfs.required'] = 'false'
4
4
 
5
5
  module Autobuild
6
6
  Git.add_post_hook do |importer, package|
7
7
  lfs_dir = File.join(package.srcdir, '.git', 'lfs')
8
- if File.directory?(lfs_dir) && importer.options[:lfs] != false
9
- package.run 'import', Autobuild.tool(:git), 'lfs', 'install', '--local', '--skip-smudge',
10
- working_directory: package.importdir
11
- package.run 'import', Autobuild.tool(:git), 'lfs', 'pull', importer.remote_name,
12
- working_directory: package.importdir
8
+ if File.directory?(lfs_dir)
9
+ importer.run_git(package, 'lfs', 'install', '--force', '--local', '--skip-smudge')
10
+
11
+ includes = importer.options.fetch(:lfs_include, '')
12
+ if includes.empty?
13
+ begin
14
+ importer.run_git_bare(package, 'config', '--local', '--unset', 'lfs.fetchinclude')
15
+ rescue SubcommandFailed => e
16
+ raise if e.status != 5
17
+ end
18
+ else
19
+ importer.run_git_bare(package, 'config', '--local', 'lfs.fetchinclude', includes)
20
+ end
21
+
22
+ excludes = importer.options.fetch(:lfs_exclude, '')
23
+ if excludes.empty?
24
+ begin
25
+ importer.run_git_bare(package, 'config', '--local', '--unset', 'lfs.fetchexclude')
26
+ rescue SubcommandFailed => e
27
+ raise if e.status != 5
28
+ end
29
+ else
30
+ importer.run_git_bare(package, 'config', '--local', 'lfs.fetchexclude', excludes)
31
+ end
32
+
33
+ if importer.options[:lfs] != false
34
+ importer.run_git(package, 'lfs', 'pull', importer.remote_name)
35
+ end
13
36
  end
14
37
  end
15
38
  end
@@ -132,7 +132,8 @@ def initialize(repository, branch = nil, options = {})
132
132
  commit: nil,
133
133
  repository_id: nil,
134
134
  source_id: nil,
135
- with_submodules: false
135
+ with_submodules: false,
136
+ single_branch: false
136
137
  if gitopts[:branch] && branch
137
138
  raise ConfigException, "git branch specified with both the option hash and the explicit parameter"
138
139
  end
@@ -140,6 +141,7 @@ def initialize(repository, branch = nil, options = {})
140
141
 
141
142
  super(common)
142
143
 
144
+ @single_branch = gitopts[:single_branch]
143
145
  @with_submodules = gitopts.delete(:with_submodules)
144
146
  @remote_name = 'autobuild'
145
147
  @push_to = nil
@@ -243,6 +245,10 @@ def merge=(flag); @merge = flag end
243
245
  # Whether the git checkout should be done with submodules
244
246
  def with_submodules?; !!@with_submodules end
245
247
 
248
+ # Whether 'clone' should fetch only the remote branch, or all the
249
+ # branches
250
+ attr_predicate :single_branch?, true
251
+
246
252
  # @api private
247
253
  #
248
254
  # Verifies that the package's {Package#importdir} points to a git
@@ -1043,6 +1049,9 @@ def checkout(package, options = Hash.new)
1043
1049
  if with_submodules?
1044
1050
  clone_options << '--recurse-submodules'
1045
1051
  end
1052
+ if single_branch?
1053
+ clone_options << "--branch=#{remote_branch}" << "--single-branch"
1054
+ end
1046
1055
  each_alternate_path(package) do |path|
1047
1056
  clone_options << '--reference' << path
1048
1057
  end
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.10.0.rc19" unless defined? Autobuild::VERSION
2
+ VERSION = "1.10.0.rc20" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0.rc19
4
+ version: 1.10.0.rc20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-02 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake