commit 200eb9a306492dfadd43a901d0170acecb8e8c0c
parent e4e0bdfa73fbdb21e93e69c3ad9d66414681201c
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date: Wed, 14 May 2014 09:42:26 +0200
Don't define tmpdir on git init.
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/password-store.sh b/src/password-store.sh
@@ -557,10 +557,6 @@ cmd_copy_move() {
}
cmd_git() {
- tmpdir nowarn #Defines $SECURE_TMPDIR. We don't warn, because at most, this only copies encrypted files.
- trap "rm -rf '$SECURE_TMPDIR'" INT TERM EXIT
- export TMPDIR="$SECURE_TMPDIR"
-
if [[ $1 == "init" ]]; then
git "$@" || exit 1
git_add_file "$PREFIX" "Add current contents of password store."
@@ -570,6 +566,9 @@ cmd_git() {
git config --local diff.gpg.binary true
git config --local diff.gpg.textconv "$GPG -d ${GPG_OPTS[*]}"
elif [[ -d $GIT_DIR ]]; then
+ tmpdir nowarn #Defines $SECURE_TMPDIR. We don't warn, because at most, this only copies encrypted files.
+ trap "rm -rf '$SECURE_TMPDIR'" INT TERM EXIT
+ export TMPDIR="$SECURE_TMPDIR"
git "$@"
else
die "Error: the password store is not a git repository. Try \"$PROGRAM git init\"."