aboutsummaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2009-06-27 17:58:46 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-27 11:14:53 -0700
commitd824cbba02a4061400a0e382f9bd241fbbff34f0 (patch)
treeae0c9be6c2778dd10c4cc207957e346855bd4418 /setup.c
parentf8b5a8e13cb4d60c8b630f92a8f07590ef218ec5 (diff)
downloadgit-d824cbba02a4061400a0e382f9bd241fbbff34f0.tar.gz
git-d824cbba02a4061400a0e382f9bd241fbbff34f0.tar.xz
Convert existing die(..., strerror(errno)) to die_errno()
Change calls to die(..., strerror(errno)) to use the new die_errno(). In the process, also make slight style adjustments: at least state _something_ about the function that failed (instead of just printing the pathname), and put paths in single quotes. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/setup.c b/setup.c
index ebd60de9c..4d27f28c8 100644
--- a/setup.c
+++ b/setup.c
@@ -81,7 +81,7 @@ void verify_filename(const char *prefix, const char *arg)
if (errno == ENOENT)
die("ambiguous argument '%s': unknown revision or path not in the working tree.\n"
"Use '--' to separate paths from revisions", arg);
- die("'%s': %s", arg, strerror(errno));
+ die_errno("failed to stat '%s'", arg);
}
/*
@@ -103,7 +103,7 @@ void verify_non_filename(const char *prefix, const char *arg)
die("ambiguous argument '%s': both revision and filename\n"
"Use '--' to separate filenames from revisions", arg);
if (errno != ENOENT && errno != ENOTDIR)
- die("'%s': %s", arg, strerror(errno));
+ die_errno("failed to stat '%s'", arg);
}
const char **get_pathspec(const char *prefix, const char **pathspec)
@@ -257,7 +257,7 @@ const char *read_gitfile_gently(const char *path)
return NULL;
fd = open(path, O_RDONLY);
if (fd < 0)
- die("Error opening %s: %s", path, strerror(errno));
+ die_errno("Error opening '%s'", path);
buf = xmalloc(st.st_size + 1);
len = read_in_full(fd, buf, st.st_size);
close(fd);
@@ -389,7 +389,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
die("Not a git repository (or any of the parent directories): %s", DEFAULT_GIT_DIR_ENVIRONMENT);
}
if (chdir(".."))
- die("Cannot change to %s/..: %s", cwd, strerror(errno));
+ die_errno("Cannot change to '%s/..'", cwd);
}
inside_git_dir = 0;