Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

if `pull-request` editor is vim, set appropriate filetype

  • Loading branch information...
commit 5f546d4242b547e82611ecc68499506c0e6ad53c 1 parent 961f4b5
@mislav mislav authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/hub/commands.rb
View
4 lib/hub/commands.rb
@@ -919,7 +919,9 @@ def pullrequest_editmsg(changes)
msg.puts changes.gsub(/^/, '# ').gsub(/ +$/, '')
end
}
- edit_cmd = Array(git_editor).dup << message_file
+ edit_cmd = Array(git_editor).dup
+ edit_cmd << '-c' << 'set ft=gitcommit' if edit_cmd[0] =~ /^[mg]?vim$/
+ edit_cmd << message_file
system(*edit_cmd)
abort "can't open text editor for pull request message" unless $?.success?
title, body = read_editmsg(message_file)
Please sign in to comment.
Something went wrong with that request. Please try again.