From 4f9ca2df8be661ab610a4de44b92c22d8f382224 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Mon, 19 Jan 2026 13:30:00 +0800 Subject: [PATCH] fixup: prevent failure when the -d/--debug flag is not provided Fixes: https://github.com/tj/git-extras/pull/1227#discussion_r2703111483 --- bin/git-guilt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/git-guilt b/bin/git-guilt index ea13728..11fea99 100755 --- a/bin/git-guilt +++ b/bin/git-guilt @@ -114,6 +114,9 @@ do printf "\033[00m\n" done -test -n "$DEBUG" && sort -nr "$DEBUG" +rm -f "$MERGED_LOG" -rm -f "$DEBUG" "$MERGED_LOG" +if [[ -n "$DEBUG" ]] ; then + sort -nr "$DEBUG" && + rm -f "$DEBUG" +fi