From 200eb9a306492dfadd43a901d0170acecb8e8c0c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 14 May 2014 09:42:26 +0200 Subject: Don't define tmpdir on git init. --- src/password-store.sh | 7 +++---- 1 file 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\"." -- cgit v1.2.3