Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xu Wang
git-crypt-unlock-all
Commits
a5d276ac
Commit
a5d276ac
authored
Apr 19, 2016
by
Xu Wang
Browse files
fix git-crypt-unlock-all.sh, unlock current repo first before unlock submodules
parent
5b6111e7
Pipeline
#315
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
git-crypt-unlock-all.sh
View file @
a5d276ac
...
...
@@ -33,6 +33,22 @@ function verify_gpg_passphrase() {
done
}
function
do_unlock
()
{
echo
unlock
$PWD
keyfile
=
$1
if
[
!
-z
$keyfile
]
;
then
git-crypt unlock
$keyfile
else
expect
<<
EOF
spawn git-crypt unlock
expect "Enter passphrase:"
send "
$passphrase
\r
";
expect eof
EOF
fi
}
# MAIN
keyfile
=
${
1
:-
''
}
if
[
-z
$keyfile
]
;
...
...
@@ -43,6 +59,10 @@ else
[
!
-f
$keyfile
]
&&
abort
"unable to read
$keyfile
."
fi
# unlock current repo
do_unlock
$keyfile
# unlock submodules
modules
=
$(
git submodule status
)
[
-z
"
$modules
"
]
&&
abort
"No submodules"
...
...
@@ -57,17 +77,7 @@ do
(
echo
"Checking out
$i
master branch"
cd
$m
git checkout master
if
[
!
-z
$keyfile
]
;
then
git-crypt unlock
$keyfile
else
expect
<<
EOF
spawn git-crypt unlock
expect "Enter passphrase:"
send "
$passphrase
\r
";
expect eof
EOF
fi
do_unlock
$keyfile
)
fi
done
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