Reduce output noise when delegated command made no change

This commit is contained in:
Peter Cai 2022-10-10 20:27:27 -04:00
parent b014a9a440
commit 75855a5e88
1 changed files with 4 additions and 2 deletions

View File

@ -130,8 +130,10 @@ gocrypt_delegate() {
# Delegate command to another `pass` instance that manages what is inside of the mountpoint
PASSWORD_STORE_DIR="$PWD/$gocrypt_dec_dir" "$PROGRAM" "$@"
# Commit if there has been changes due to this operation
_cmd_git add "$gocrypt_dir"
_cmd_git commit -m "Encrypted pass operation inside gocrypt" "$gocrypt_dir" || echo "No git commit created"
if [[ `_cmd_git status --porcelain=v1 "$gocrypt_dir"` ]]; then
_cmd_git add "$gocrypt_dir"
_cmd_git commit -m "Encrypted pass operation inside gocrypt" "$gocrypt_dir" || echo "No git commit created"
fi
}
gocrypt_crypt() {