summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a2d6b87)
raw | patch | inline | side by side (parent: a2d6b87)
author | Gerrit Pape <pape@smarden.org> | |
Fri, 12 Oct 2007 11:40:57 +0000 (11:40 +0000) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 18 Oct 2007 05:35:33 +0000 (01:35 -0400) |
Instead of simply exiting with 255, print an error message including
the reason why a config file specified through --file cannot be opened
or read.
The problem was noticed by Joey Hess, reported through
http://bugs.debian.org/445208
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
the reason why a config file specified through --file cannot be opened
or read.
The problem was noticed by Joey Hess, reported through
http://bugs.debian.org/445208
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
builtin-config.c | patch | blob | history |
diff --git a/builtin-config.c b/builtin-config.c
index d98b6c2c4cbbec367e498d33c5f670709dcac893..e5e243f27cb7ecab11ac0933a361d066f5b35ea9 100644 (file)
--- a/builtin-config.c
+++ b/builtin-config.c
else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l")) {
if (argc != 2)
usage(git_config_set_usage);
- return git_config(show_all_config);
+ if (git_config(show_all_config) < 0 && file && errno)
+ die("unable to read config file %s: %s", file,
+ strerror(errno));
+ return 0;
}
else if (!strcmp(argv[1], "--global")) {
char *home = getenv("HOME");