summaryrefslogtreecommitdiff
path: root/src/refdb_fs.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-12-29 12:25:15 +0000
committerEdward Thomson <ethomson@github.com>2016-12-29 12:26:03 +0000
commit909d5494368a00809bc42f4780e86f4dd66e4422 (patch)
tree637e98589830666f2326b37bcfcfc25dfc773b5a /src/refdb_fs.c
parent238b8ccd1aeec0e0d6e50c5050527a8107304bfb (diff)
downloadlibgit2-909d5494368a00809bc42f4780e86f4dd66e4422.tar.gz
giterr_set: consistent error messages
Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
Diffstat (limited to 'src/refdb_fs.c')
-rw-r--r--src/refdb_fs.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index 8739d5b89..e40f48bd5 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -185,7 +185,7 @@ static int packed_reload(refdb_fs_backend *backend)
return 0;
parse_failed:
- giterr_set(GITERR_REFERENCE, "Corrupted packed references file");
+ giterr_set(GITERR_REFERENCE, "corrupted packed references file");
git_sortedcache_clear(backend->refcache, false);
git_sortedcache_wunlock(backend->refcache);
@@ -212,7 +212,7 @@ static int loose_parse_oid(
return 0;
corrupted:
- giterr_set(GITERR_REFERENCE, "Corrupted loose reference file: %s", filename);
+ giterr_set(GITERR_REFERENCE, "corrupted loose reference file: %s", filename);
return -1;
}
@@ -349,7 +349,7 @@ static const char *loose_parse_symbolic(git_buf *file_content)
refname_start = (const char *)file_content->ptr;
if (git_buf_len(file_content) < header_len + 1) {
- giterr_set(GITERR_REFERENCE, "Corrupted loose reference file");
+ giterr_set(GITERR_REFERENCE, "corrupted loose reference file");
return NULL;
}
@@ -398,7 +398,7 @@ static int loose_lookup(
static int ref_error_notfound(const char *name)
{
- giterr_set(GITERR_REFERENCE, "Reference '%s' not found", name);
+ giterr_set(GITERR_REFERENCE, "reference '%s' not found", name);
return GIT_ENOTFOUND;
}
@@ -691,7 +691,7 @@ static int reference_path_available(
if (exists) {
giterr_set(GITERR_REFERENCE,
- "Failed to write reference '%s': a reference with "
+ "failed to write reference '%s': a reference with "
"that name already exists.", new_ref);
return GIT_EEXISTS;
}
@@ -705,7 +705,7 @@ static int reference_path_available(
if (ref && !ref_is_available(old_ref, new_ref, ref->name)) {
git_sortedcache_runlock(backend->refcache);
giterr_set(GITERR_REFERENCE,
- "Path to reference '%s' collides with existing one", new_ref);
+ "path to reference '%s' collides with existing one", new_ref);
return -1;
}
}
@@ -722,7 +722,7 @@ static int loose_lock(git_filebuf *file, refdb_fs_backend *backend, const char *
assert(file && backend && name);
if (!git_path_isvalid(backend->repo, name, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) {
- giterr_set(GITERR_INVALID, "Invalid reference name '%s'.", name);
+ giterr_set(GITERR_INVALID, "invalid reference name '%s'", name);
return GIT_EINVALIDSPEC;
}
@@ -1484,7 +1484,7 @@ static int reflog_parse(git_reflog *log, const char *buf, size_t buf_size)
#define seek_forward(_increase) do { \
if (_increase >= buf_size) { \
- giterr_set(GITERR_INVALID, "Ran out of data while parsing reflog"); \
+ giterr_set(GITERR_INVALID, "ran out of data while parsing reflog"); \
goto fail; \
} \
buf += _increase; \
@@ -1700,7 +1700,7 @@ static int lock_reflog(git_filebuf *file, refdb_fs_backend *backend, const char
repo = backend->repo;
if (!git_path_isvalid(backend->repo, refname, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) {
- giterr_set(GITERR_INVALID, "Invalid reference name '%s'.", refname);
+ giterr_set(GITERR_INVALID, "invalid reference name '%s'", refname);
return GIT_EINVALIDSPEC;
}
@@ -1709,7 +1709,7 @@ static int lock_reflog(git_filebuf *file, refdb_fs_backend *backend, const char
if (!git_path_isfile(git_buf_cstr(&log_path))) {
giterr_set(GITERR_INVALID,
- "Log file for reference '%s' doesn't exist.", refname);
+ "log file for reference '%s' doesn't exist", refname);
error = -1;
goto cleanup;
}
@@ -1889,7 +1889,7 @@ static int refdb_reflog_fs__rename(git_refdb_backend *_backend, const char *old_
p_close(fd);
if (p_rename(git_buf_cstr(&old_path), git_buf_cstr(&temp_path)) < 0) {
- giterr_set(GITERR_OS, "Failed to rename reflog for %s", new_name);
+ giterr_set(GITERR_OS, "failed to rename reflog for %s", new_name);
error = -1;
goto cleanup;
}
@@ -1906,7 +1906,7 @@ static int refdb_reflog_fs__rename(git_refdb_backend *_backend, const char *old_
}
if (p_rename(git_buf_cstr(&temp_path), git_buf_cstr(&new_path)) < 0) {
- giterr_set(GITERR_OS, "Failed to rename reflog for %s", new_name);
+ giterr_set(GITERR_OS, "failed to rename reflog for %s", new_name);
error = -1;
}