m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-12-23 19:50:43 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2014-12-23 19:50:43 -0700
commitd28575ddcaa6ef2420507416d64dff01e402a5c5 (patch)
tree5f877e7994f7970bfd77a43aa9a9a2a6d966d931 /src
parentc34d172ec14b06de82c04eecf86af66cd26379d6 (diff)
Do not make commit with edit if password is unchanged.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/password-store.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 7cf560c..d44b005 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -431,6 +431,7 @@ cmd_edit() {
fi
${EDITOR:-vi} "$tmp_file"
[[ -f $tmp_file ]] || die "New password not saved."
+ $GPG -d -o - "${GPG_OPTS[@]}" "$passfile" | diff - "$tmp_file" &>/dev/null && die "Password unchanged."
while ! $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}" "$tmp_file"; do
yesno "GPG encryption failed. Would you like to try again?"
done