autobuild 1.4.6 → 1.4.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes.txt +3 -0
- data/lib/autobuild.rb +1 -1
- data/lib/autobuild/import/git.rb +21 -3
- metadata +3 -3
data/Changes.txt
CHANGED
data/lib/autobuild.rb
CHANGED
data/lib/autobuild/import/git.rb
CHANGED
@@ -84,18 +84,36 @@ module Autobuild
|
|
84
84
|
def fetch_remote(package)
|
85
85
|
validate_srcdir(package)
|
86
86
|
Dir.chdir(package.srcdir) do
|
87
|
-
|
88
|
-
|
87
|
+
# Update the remote definition
|
88
|
+
Subprocess.run(package, :import, Autobuild.tool('git'), 'config',
|
89
|
+
"--replace-all", "remote.autobuild.url", repository)
|
90
|
+
Subprocess.run(package, :import, Autobuild.tool('git'), 'config',
|
91
|
+
"--replace-all", "remote.autobuild.fetch", "+refs/heads/*:refs/remotes/autobuild/*")
|
92
|
+
|
93
|
+
# We are checking out a specific commit. We just call git fetch
|
94
|
+
if commit
|
95
|
+
Subprocess.run(package, :import, Autobuild.tool('git'), 'fetch', 'autobuild')
|
89
96
|
else
|
90
97
|
Subprocess.run(package, :import, Autobuild.tool('git'), 'fetch', repository, branch || tag)
|
91
98
|
end
|
92
|
-
|
99
|
+
|
100
|
+
# Now get the actual commit ID from the FETCH_HEAD file, and
|
101
|
+
# return it
|
102
|
+
commit_id = if File.readable?( File.join('.git', 'FETCH_HEAD') )
|
93
103
|
fetch_commit = File.readlines( File.join('.git', 'FETCH_HEAD') ).
|
94
104
|
delete_if { |l| l =~ /not-for-merge/ }
|
95
105
|
if !fetch_commit.empty?
|
96
106
|
fetch_commit.first.split(/\s+/).first
|
97
107
|
end
|
98
108
|
end
|
109
|
+
|
110
|
+
# Update the remote tag if needs be
|
111
|
+
if branch && commit_id
|
112
|
+
Subprocess.run(package, :import, Autobuild.tool('git'), 'update-ref',
|
113
|
+
"-m", "updated by autobuild", "refs/remotes/autobuild/#{branch}", commit_id)
|
114
|
+
end
|
115
|
+
|
116
|
+
commit_id
|
99
117
|
end
|
100
118
|
end
|
101
119
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autobuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-08 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
requirements:
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 2.
|
63
|
+
version: 2.4.0
|
64
64
|
version:
|
65
65
|
description: |-
|
66
66
|
This work is licensed under the GPLv2 license. See License.txt for details
|