@@ -1075,12 +1075,16 @@ function! s:hash_match(a, b)
10751075 return stridx (a: a , a: b ) == 0 || stridx (a: b , a: a ) == 0
10761076endfunction
10771077
1078+ function ! s: disable_credential_helper ()
1079+ return s: git_version_requirement (2 ) && get (g: , ' plug_disable_credential_helper' , 1 )
1080+ endfunction
1081+
10781082function ! s: checkout (spec)
10791083 let sha = a: spec .commit
10801084 let output = s: git_revision (a: spec .dir )
10811085 let error = 0
10821086 if ! empty (output) && ! s: hash_match (sha, s: lines (output)[0 ])
1083- let credential_helper = s: git_version_requirement ( 2 ) ? ' -c credential.helper= ' : ' '
1087+ let credential_helper = s: disable_credential_helper ( ) ? ' -c credential.helper= ' : ' '
10841088 let output = s: system (
10851089 \ ' git ' .credential_helper.' fetch --depth 999999 && git checkout ' .plug#shellescape (sha).' --' , a: spec .dir )
10861090 let error = v: shell_error
@@ -1589,7 +1593,7 @@ while 1 " Without TCO, Vim stack is bound to explode
15891593 let [error , _] = s: git_validate (spec, 0 )
15901594 if empty (error )
15911595 if pull
1592- let cmd = s: git_version_requirement ( 2 ) ? [' git' , ' -c' , ' credential.helper=' , ' fetch' ] : [' git' , ' fetch' ]
1596+ let cmd = s: disable_credential_helper ( ) ? [' git' , ' -c' , ' credential.helper=' , ' fetch' ] : [' git' , ' fetch' ]
15931597 if has_tag && ! empty (globpath (spec.dir , ' .git/shallow' ))
15941598 call extend (cmd, [' --depth' , ' 99999999' ])
15951599 endif
0 commit comments