From 9ef311d868248682a11c8cb8c0177bc9949be7b9 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 20 Mar 2014 01:33:18 -0600 Subject: git: sign commits if enabled --- src/password-store.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/password-store.sh b/src/password-store.sh index f7ad52b..a5d3374 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -69,7 +69,8 @@ git_add_file() { [[ -d $GIT_DIR ]] || return git add "$1" || return [[ -n $(git status --porcelain "$1") ]] || return - git commit -m "$2" + [[ $(git config --bool --get pass.signcommits) == "true" ]] && sign="-S" || sign="" + git commit $sign -m "$2" } yesno() { read -r -p "$1 [y/N] " response -- cgit v1.2.3