summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-01-22 19:25:08 +0100
committerJohn Ankarström <john@ankarstrom.se>2022-01-22 19:25:08 +0100
commit6020c9326843ee232a4fea3b2be13f9f3516abbb (patch)
tree0d3736ffe8dc3d02d2fc87b73aaa03e1f41d5824
parent0fc1703d4dbd29b4f03cca18aa318903a8e67bab (diff)
downloadsave-6020c9326843ee232a4fea3b2be13f9f3516abbb.tar.gz
Improve git-add error handling.
-rw-r--r--save.pl10
1 files 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.