From 0ca819ffc4a733668164ae30e60039b0de6f7ffc Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Mon, 29 Jul 2024 17:52:22 -0700 Subject: [PATCH] don't spit out `git status` when there's nothing to do --- regenerate | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/regenerate b/regenerate index b3a4223..fb739d7 100755 --- a/regenerate +++ b/regenerate @@ -76,6 +76,10 @@ else if [ "$1" = commit ]; then mv README.md~ README.md || die 'failed to overwrite readme' - git commit README.md -m 'regenerate readme' || die 'failed to commit' + if ! git diff --no-patch --exit-code README.md; then + git commit README.md -m 'regenerate readme' || die 'failed to commit' + else + warn 'nothing to do' + fi fi fi