braid 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/braid/commands/push.rb +19 -4
- data/lib/braid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f27ef2c42cd4181967aa09dfb553f0830e15185c
|
4
|
+
data.tar.gz: f138de7633616c00ee483c9b58902cdb8e313b3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4305c95e52816fe64157d24e263d1d1309cd490ae8caf203c74d3fbfbb32951072a4fa387ab27e3e8cc20b227142204d1fade6f2fdab08ea93219e9479071a14
|
7
|
+
data.tar.gz: 1896dce83a4f455cd189ef87cb1fe09aeff7b81cc4ba327cc5f36c2c0310027b0ea061c45f1f426ac4fddb2466c0a511a37cd1d4e0da283fea1e4a85cfd3e7d4
|
data/lib/braid/commands/push.rb
CHANGED
@@ -33,7 +33,14 @@ module Braid
|
|
33
33
|
clear_remote(mirror, options)
|
34
34
|
return
|
35
35
|
end
|
36
|
+
local_mirror_tree = git.rev_parse("HEAD:#{mirror.path}")
|
36
37
|
|
38
|
+
odb_paths = [File.expand_path(git.repo_file_path('objects'))]
|
39
|
+
if File.exist?(mirror.cached_url)
|
40
|
+
Dir.chdir(mirror.cached_url) do
|
41
|
+
odb_paths.push(File.expand_path(git.repo_file_path('objects')))
|
42
|
+
end
|
43
|
+
end
|
37
44
|
clone_dir = Dir.tmpdir + "/braid_push.#{$$}"
|
38
45
|
Dir.mkdir(clone_dir)
|
39
46
|
remote_url = git.remote_url(mirror.remote)
|
@@ -49,12 +56,20 @@ module Braid
|
|
49
56
|
git.init
|
50
57
|
git.config(['--local', 'user.name', "\"#{user_name}\""]) if user_name
|
51
58
|
git.config(['--local', 'user.email', "\"#{user_email}\""]) if user_email
|
52
|
-
|
59
|
+
# Adding other repositories as alternates is safe (we don't have to
|
60
|
+
# worry about them being moved or deleted during the lifetime of this
|
61
|
+
# temporary repository) and faster than fetching from them. We don't
|
62
|
+
# need git.repo_file_path because the temporary repository isn't using
|
63
|
+
# a linked worktree.
|
64
|
+
File.open('.git/objects/info/alternates', 'w') { |f|
|
65
|
+
f.puts(odb_paths)
|
66
|
+
}
|
53
67
|
git.fetch(remote_url, mirror.remote_ref)
|
54
68
|
git.checkout(base_revision)
|
55
|
-
|
56
|
-
|
57
|
-
|
69
|
+
git.rm_r(mirror.remote_path || '.')
|
70
|
+
# Yes, when mirror.remote_path is unset, "git read-tree --prefix=/"
|
71
|
+
# seems to work. :/
|
72
|
+
git.read_tree_prefix_u(local_mirror_tree, mirror.remote_path || '')
|
58
73
|
system('git commit -v')
|
59
74
|
msg "Pushing changes to remote branch #{branch}."
|
60
75
|
git.push(remote_url, "HEAD:refs/heads/#{branch}")
|
data/lib/braid/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: braid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cristi Balan
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-05-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: main
|