summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-05-14 09:42:26 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-05-14 09:42:35 +0200
commit200eb9a306492dfadd43a901d0170acecb8e8c0c (patch)
treee0c4eae8d696a618b3359e30547946e019932430 /src
parente4e0bdfa73fbdb21e93e69c3ad9d66414681201c (diff)
downloadpass-200eb9a306492dfadd43a901d0170acecb8e8c0c.tar.gz
pass-200eb9a306492dfadd43a901d0170acecb8e8c0c.tar.bz2
pass-200eb9a306492dfadd43a901d0170acecb8e8c0c.zip
Don't define tmpdir on git init.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/password-store.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index dadeea4..41ff3f9 100755
--- 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\"."