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

This commit is contained in:
Mislav Marohnić 2012-02-07 21:12:11 +01:00
Родитель 961f4b5fa1
Коммит 5f546d4242
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -919,7 +919,9 @@ help
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)