lib/braid/operations.rb in braid-1.1.6 vs lib/braid/operations.rb in braid-1.1.7

- old
+ new

@@ -59,11 +59,11 @@ name.split('::').last.downcase; end # hax! def version - status, out, err = exec!("#{self.class.command} --version") + _, out, _ = exec!("#{self.class.command} --version") out.sub(/^.* version/, '').strip.sub(/ .*$/, '').strip end def require_version(required) # Gem::Version is intended for Ruby gem versions, but various web sites @@ -164,10 +164,11 @@ invoke(:rev_parse, '--show-prefix') end def commit(message, *args) cmd = 'git commit --no-verify' + message_file = nil if message # allow nil message_file = Tempfile.new('braid_commit') message_file.print("Braid: #{message}") message_file.flush message_file.close @@ -301,11 +302,11 @@ end else # According to # https://lore.kernel.org/git/e48a281a4d3db0a04c0609fcb8658e4fcc797210.1646166271.git.gitgitgadget@gmail.com/, # `--prefix=` is valid if the path is empty. - res = invoke(:read_tree, "--prefix=#{path}", update_worktree ? '-u' : '-i', item) + invoke(:read_tree, "--prefix=#{path}", update_worktree ? '-u' : '-i', item) end end # Read tree into the root of the index. This may not be the preferred way # to do it, but it seems to work. @@ -368,11 +369,11 @@ # quits the pager before reading all the output. system("git diff #{args.join(' ')}") end def status_clean? - status, out, err = exec('git status') + _, out, _ = exec('git status') !out.split("\n").grep(/nothing to commit/).empty? end def ensure_clean! status_clean? || raise(LocalChangesPresent) @@ -381,10 +382,10 @@ def head rev_parse('HEAD') end def branch - status, out, err = exec!("git branch | grep '*'") + _, out, _ = exec!("git branch | grep '*'") out[2..-1] end def clone(*args) # overrides builtin