26df8a22741ea4bb5264233344e42ce900fd26b6

Author
Syphdias <syphdias+git@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

git-auto-fetch: stop plugin from asking for ssh-key passphrase (#8399)

Diff

 1diff --git a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
 2index 56ab86dbed4572d2b3eec57f93e994aeabeb2341..5c42c21a78b14bc05b273513194beb1b1118c697 100644
 3--- a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
 4+++ b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
 5@@ -1,16 +1,17 @@
 6 GIT_AUTO_FETCH_INTERVAL=${GIT_AUTO_FETCH_INTERVAL:=60}
 7 
 8 function git-fetch-all {
 9-  (`git rev-parse --is-inside-work-tree 2>/dev/null` &&
10-  dir=`git rev-parse --git-dir` &&
11+  (`command git rev-parse --is-inside-work-tree 2>/dev/null` &&
12+  dir=`command git rev-parse --git-dir` &&
13   [[ ! -f $dir/NO_AUTO_FETCH ]] &&
14   (( `date +%s` - `date -r $dir/FETCH_LOG +%s 2>/dev/null || echo 0` > $GIT_AUTO_FETCH_INTERVAL )) &&
15-  git fetch --all 2>/dev/null &>! $dir/FETCH_LOG &)
16+  GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \
17+    command git fetch --all 2>/dev/null &>! $dir/FETCH_LOG &)
18 }
19 
20 function git-auto-fetch {
21-  `git rev-parse --is-inside-work-tree 2>/dev/null` || return
22-  guard="`git rev-parse --git-dir`/NO_AUTO_FETCH"
23+  `command git rev-parse --is-inside-work-tree 2>/dev/null` || return
24+  guard="`command git rev-parse --git-dir`/NO_AUTO_FETCH"
25 
26   (rm $guard 2>/dev/null &&
27     echo "${fg_bold[green]}enabled${reset_color}") ||