diff --git a/gocrypt.bash b/gocrypt.bash index d5bf021..e6c96f4 100755 --- a/gocrypt.bash +++ b/gocrypt.bash @@ -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() {