braid 1.0.14 → 1.0.15

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: 2ea7f832727df1483b0ba45181553cf061f2539a
4
- data.tar.gz: dab214bf42041f02f3b6edd29cc8229866689199
3
+ metadata.gz: afbdb15969e052393b88693a8b6079066d180052
4
+ data.tar.gz: a5198d79c0cff3d4ba868d3e644d4233d2838e99
5
5
  SHA512:
6
- metadata.gz: 5aba65dd373480d84c90ea6d4ff7c1e664fcf360d1c344339dccf1a5f92c20f8c2c392793dce5f58cbad7c081d35044a55e64b6871067dbb861080dc796b4d8f
7
- data.tar.gz: 190985839fe84ff0157dda1debcd3021c547e1a5d8164f011fab647ba644323957e62158f462dcd6a115da1f40797c418f054da5e9791a016d9f69f5c9dafdd0
6
+ metadata.gz: 75ffd2beb47c5cb36320e1a326ffb48d6bc6d2e8aaaf83e809b5e22cbbf763cbe63e31261f577fff8d6cad4102247fb98315362d095dbcc3e5da2471e09910a0
7
+ data.tar.gz: 0c53d7fda15233809526ef8b45318ce9175a8d2ea4030d786e46a9601fc397a822674842a9a9975e67a22716846c8a6a97e77d025de362a4974d6292d1197225
data/.travis.yml CHANGED
@@ -4,7 +4,6 @@ rvm:
4
4
  - 2.3.1
5
5
  - 1.9.3
6
6
  - jruby-19mode
7
- - jruby-18mode
8
7
  addons:
9
8
  apt:
10
9
  sources:
@@ -86,7 +86,8 @@ module Braid
86
86
 
87
87
  commit_message = "Update mirror '#{mirror.path}' to #{display_revision(mirror)}"
88
88
  if in_error
89
- File.open('.git/MERGE_MSG', 'w') { |f| f.puts(commit_message) }
89
+ merge_msg_path = git.repo_file_path('MERGE_MSG')
90
+ File.open(merge_msg_path, 'w') { |f| f.puts(commit_message) }
90
91
  return
91
92
  end
92
93
 
@@ -161,6 +161,18 @@ module Braid
161
161
  end
162
162
 
163
163
  class Git < Proxy
164
+ # Get the physical path to a file in the git repository (e.g.,
165
+ # 'MERGE_MSG'), taking into account worktree configuration. The returned
166
+ # path may be absolute or relative to the current working directory.
167
+ def repo_file_path(path)
168
+ if require_version('2.5') # support for --git-path
169
+ invoke(:rev_parse, '--git-path', path)
170
+ else
171
+ # Git < 2.5 doesn't support linked worktrees anyway.
172
+ File.join(invoke(:rev_parse, '--git-dir'), path)
173
+ end
174
+ end
175
+
164
176
  def commit(message, *args)
165
177
  cmd = 'git commit --no-verify'
166
178
  if message # allow nil
data/lib/braid/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Braid
2
- VERSION = '1.0.14'
2
+ VERSION = '1.0.15'
3
3
  end
@@ -8,7 +8,7 @@ require 'pathname'
8
8
 
9
9
  TMP_PATH = File.join(Dir.tmpdir, 'braid_integration')
10
10
  EDITOR_CMD = "#{TMP_PATH}/editor"
11
- EDITOR_CMD_PREFIX = "GIT_EDITOR=#{EDITOR_CMD}"
11
+ EDITOR_CMD_PREFIX = "export GIT_EDITOR=#{EDITOR_CMD};"
12
12
  BRAID_PATH = Pathname.new(File.dirname(__FILE__)).parent.realpath
13
13
  FIXTURE_PATH = File.join(BRAID_PATH, 'spec', 'fixtures')
14
14
  FileUtils.rm_rf(TMP_PATH)
@@ -19,7 +19,7 @@ BRAID_BIN = ((defined?(JRUBY_VERSION) || Gem.win_platform?) ? 'ruby ' : '') + Fi
19
19
  def set_editor_message(message = 'Make some changes')
20
20
  File.write(EDITOR_CMD, <<CMD)
21
21
  #!/usr/bin/env ruby
22
- File.write(ARGV[0], #{message.inspect})
22
+ File.open(ARGV[0], 'w') { |file| file.write(#{message.inspect}) }
23
23
  CMD
24
24
  FileUtils.chmod 0755, EDITOR_CMD
25
25
  end
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.14
4
+ version: 1.0.15
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-03-18 00:00:00.000000000 Z
13
+ date: 2017-03-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: main