From 6020c9326843ee232a4fea3b2be13f9f3516abbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 22 Jan 2022 19:25:08 +0100 Subject: Improve git-add error handling. --- save.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/save.pl b/save.pl index a387f9a..517193e 100644 --- a/save.pl +++ b/save.pl @@ -34,12 +34,14 @@ init :- shell("git add .", Status), added(Status). -added(1) :- +added(S) :- + dif(S, 0), + !, send(@display, report, error, - 'Files could not be added to index. -Ensure Git is in PATH.'). + 'Files could not be added to index. Ensure Git is in PATH +and that the current directory is a Git repository.'). -added(0) :- +added(_) :- %send(@pce, load_defaults, 'Defaults'), % Right side. -- cgit v1.2.3