Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
26df8a22
Commit
26df8a22
authored
Nov 18, 2019
by
Syphdias
Committed by
Marc Cornellà
Nov 18, 2019
Browse files
git-auto-fetch: stop plugin from asking for ssh-key passphrase (#8399)
parent
4888d4ad
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
View file @
26df8a22
GIT_AUTO_FETCH_INTERVAL
=
${
GIT_AUTO_FETCH_INTERVAL
:
=60
}
GIT_AUTO_FETCH_INTERVAL
=
${
GIT_AUTO_FETCH_INTERVAL
:
=60
}
function
git-fetch-all
{
function
git-fetch-all
{
(
`
git rev-parse
--is-inside-work-tree
2>/dev/null
`
&&
(
`
command
git rev-parse
--is-inside-work-tree
2>/dev/null
`
&&
dir
=
`
git rev-parse
--git-dir
`
&&
dir
=
`
command
git rev-parse
--git-dir
`
&&
[[
!
-f
$dir
/NO_AUTO_FETCH
]]
&&
[[
!
-f
$dir
/NO_AUTO_FETCH
]]
&&
((
`
date
+%s
`
-
`
date
-r
$dir
/FETCH_LOG +%s 2>/dev/null
||
echo
0
`
>
$GIT_AUTO_FETCH_INTERVAL
))
&&
((
`
date
+%s
`
-
`
date
-r
$dir
/FETCH_LOG +%s 2>/dev/null
||
echo
0
`
>
$GIT_AUTO_FETCH_INTERVAL
))
&&
git fetch
--all
2>/dev/null &>!
$dir
/FETCH_LOG &
)
GIT_SSH_COMMAND
=
"command ssh -o BatchMode=yes"
\
command
git fetch
--all
2>/dev/null &>!
$dir
/FETCH_LOG &
)
}
}
function
git-auto-fetch
{
function
git-auto-fetch
{
`
git rev-parse
--is-inside-work-tree
2>/dev/null
`
||
return
`
command
git rev-parse
--is-inside-work-tree
2>/dev/null
`
||
return
guard
=
"
`
git rev-parse
--git-dir
`
/NO_AUTO_FETCH"
guard
=
"
`
command
git rev-parse
--git-dir
`
/NO_AUTO_FETCH"
(
rm
$guard
2>/dev/null
&&
(
rm
$guard
2>/dev/null
&&
echo
"
${
fg_bold
[green]
}
enabled
${
reset_color
}
"
)
||
echo
"
${
fg_bold
[green]
}
enabled
${
reset_color
}
"
)
||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment