From d28575ddcaa6ef2420507416d64dff01e402a5c5 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 23 Dec 2014 19:50:43 -0700 Subject: Do not make commit with edit if password is unchanged. --- src/password-store.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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 -- cgit v1.2.3-59-g8ed1b