[pass] [PATCH] git: add ability to clone a password store

Silvio Fricke silvio.fricke at gmail.com
Mon May 19 08:38:26 CEST 2014


Signed-off-by: Silvio Fricke <silvio.fricke at gmail.com>
---

Changes:

* v2: rebased to new master at v1.6.2


 src/password-store.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/password-store.sh b/src/password-store.sh
index 460aa63..788c4b0 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -565,6 +565,9 @@ cmd_git() {
 		git_add_file .gitattributes "Configure git repository for gpg file diff."
 		git config --local diff.gpg.binary true
 		git config --local diff.gpg.textconv "$GPG -d ${GPG_OPTS[*]}"
+	elif [[ $1 == "clone" ]]; then
+		[[ -d "$PREFIX" ]] && die "Error: you have a password store in $PREFIX. Move it out of the way."
+		git "$@" "$GIT_DIR"
 	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
-- 
1.9.2



More information about the Password-Store mailing list