Support :Gcommit on older Git versions

This commit is contained in:
Tim Pope 2011-04-19 18:24:33 -04:00
parent 4b69204679
commit e047558bee

View File

@ -720,7 +720,7 @@ function! s:Commit(args) abort
else
let errors = readfile(errorfile)
let error = get(errors,-2,get(errors,-1,'!'))
if error =~# "'false'\\.$"
if error =~# '\<false''\=\.$'
let args = a:args
let args = s:gsub(args,'%(%(^| )-- )@<!%(^| )@<=%(-[se]|--edit|--interactive)%($| )','')
let args = s:gsub(args,'%(%(^| )-- )@<!%(^| )@<=%(-F|--file|-m|--message)%(\s+|\=)%(''[^'']*''|"%(\\.|[^"])*"|\\.|\S)*','')