summaryrefslogtreecommitdiff
path: root/src/win32
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/win32
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/win32')
-rw-r--r--src/win32/dir.c6
-rw-r--r--src/win32/findfile.c2
-rw-r--r--src/win32/map.c12
-rw-r--r--src/win32/w32_crtdbg_stacktrace.c4
-rw-r--r--src/win32/w32_util.c2
-rw-r--r--src/win32/w32_util.h2
6 files changed, 14 insertions, 14 deletions
diff --git a/src/win32/dir.c b/src/win32/dir.c
index c15757085..8a724a4e9 100644
--- a/src/win32/dir.c
+++ b/src/win32/dir.c
@@ -28,7 +28,7 @@ git__DIR *git__opendir(const char *dir)
new->h = FindFirstFileW(filter_w, &new->f);
if (new->h == INVALID_HANDLE_VALUE) {
- giterr_set(GITERR_OS, "Could not open directory '%s'", dir);
+ giterr_set(GITERR_OS, "could not open directory '%s'", dir);
git__free(new);
return NULL;
}
@@ -53,7 +53,7 @@ int git__readdir_ext(
else if (!FindNextFileW(d->h, &d->f)) {
if (GetLastError() == ERROR_NO_MORE_FILES)
return 0;
- giterr_set(GITERR_OS, "Could not read from directory '%s'", d->dir);
+ giterr_set(GITERR_OS, "could not read from directory '%s'", d->dir);
return -1;
}
@@ -98,7 +98,7 @@ void git__rewinddir(git__DIR *d)
d->h = FindFirstFileW(filter_w, &d->f);
if (d->h == INVALID_HANDLE_VALUE)
- giterr_set(GITERR_OS, "Could not open directory '%s'", d->dir);
+ giterr_set(GITERR_OS, "could not open directory '%s'", d->dir);
else
d->first = 1;
}
diff --git a/src/win32/findfile.c b/src/win32/findfile.c
index 58c22279e..1c768f7f4 100644
--- a/src/win32/findfile.c
+++ b/src/win32/findfile.c
@@ -38,7 +38,7 @@ static int win32_path_to_8(git_buf *dest, const wchar_t *src)
git_win32_utf8_path utf8_path;
if (git_win32_path_to_utf8(utf8_path, src) < 0) {
- giterr_set(GITERR_OS, "Unable to convert path to UTF-8");
+ giterr_set(GITERR_OS, "unable to convert path to UTF-8");
return -1;
}
diff --git a/src/win32/map.c b/src/win32/map.c
index 03a3646a6..5fcc1085b 100644
--- a/src/win32/map.c
+++ b/src/win32/map.c
@@ -67,7 +67,7 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
if (fh == INVALID_HANDLE_VALUE) {
errno = EBADF;
- giterr_set(GITERR_OS, "Failed to mmap. Invalid handle value");
+ giterr_set(GITERR_OS, "failed to mmap. Invalid handle value");
return -1;
}
@@ -86,13 +86,13 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
if (page_offset != 0) { /* offset must be multiple of the allocation granularity */
errno = EINVAL;
- giterr_set(GITERR_OS, "Failed to mmap. Offset must be multiple of allocation granularity");
+ giterr_set(GITERR_OS, "failed to mmap. Offset must be multiple of allocation granularity");
return -1;
}
out->fmh = CreateFileMapping(fh, NULL, fmap_prot, 0, 0, NULL);
if (!out->fmh || out->fmh == INVALID_HANDLE_VALUE) {
- giterr_set(GITERR_OS, "Failed to mmap. Invalid handle value");
+ giterr_set(GITERR_OS, "failed to mmap. Invalid handle value");
out->fmh = NULL;
return -1;
}
@@ -103,7 +103,7 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
off_hi = (DWORD)(page_start >> 32);
out->data = MapViewOfFile(out->fmh, view_prot, off_hi, off_low, len);
if (!out->data) {
- giterr_set(GITERR_OS, "Failed to mmap. No data written");
+ giterr_set(GITERR_OS, "failed to mmap. No data written");
CloseHandle(out->fmh);
out->fmh = NULL;
return -1;
@@ -121,7 +121,7 @@ int p_munmap(git_map *map)
if (map->data) {
if (!UnmapViewOfFile(map->data)) {
- giterr_set(GITERR_OS, "Failed to munmap. Could not unmap view of file");
+ giterr_set(GITERR_OS, "failed to munmap. Could not unmap view of file");
error = -1;
}
map->data = NULL;
@@ -129,7 +129,7 @@ int p_munmap(git_map *map)
if (map->fmh) {
if (!CloseHandle(map->fmh)) {
- giterr_set(GITERR_OS, "Failed to munmap. Could not close handle");
+ giterr_set(GITERR_OS, "failed to munmap. Could not close handle");
error = -1;
}
map->fmh = NULL;
diff --git a/src/win32/w32_crtdbg_stacktrace.c b/src/win32/w32_crtdbg_stacktrace.c
index a778f4164..2dbdaf45b 100644
--- a/src/win32/w32_crtdbg_stacktrace.c
+++ b/src/win32/w32_crtdbg_stacktrace.c
@@ -253,11 +253,11 @@ int git_win32__crtdbg_stacktrace__dump(
bool b_quiet = IS_BIT_SET(opt, GIT_WIN32__CRTDBG_STACKTRACE__QUIET);
if (b_leaks_since_mark && b_leaks_total) {
- giterr_set(GITERR_INVALID, "Cannot combine LEAKS_SINCE_MARK and LEAKS_TOTAL.");
+ giterr_set(GITERR_INVALID, "cannot combine LEAKS_SINCE_MARK and LEAKS_TOTAL.");
return GIT_ERROR;
}
if (!b_set_mark && !b_leaks_since_mark && !b_leaks_total) {
- giterr_set(GITERR_INVALID, "Nothing to do.");
+ giterr_set(GITERR_INVALID, "nothing to do.");
return GIT_ERROR;
}
diff --git a/src/win32/w32_util.c b/src/win32/w32_util.c
index 60311bb50..b7b1ffa10 100644
--- a/src/win32/w32_util.c
+++ b/src/win32/w32_util.c
@@ -68,7 +68,7 @@ int git_win32__set_hidden(const char *path, bool hidden)
newattrs = attrs & ~FILE_ATTRIBUTE_HIDDEN;
if (attrs != newattrs && !SetFileAttributesW(buf, newattrs)) {
- giterr_set(GITERR_OS, "Failed to %s hidden bit for '%s'",
+ giterr_set(GITERR_OS, "failed to %s hidden bit for '%s'",
hidden ? "set" : "unset", path);
return -1;
}
diff --git a/src/win32/w32_util.h b/src/win32/w32_util.h
index 784a7a04c..77973b502 100644
--- a/src/win32/w32_util.h
+++ b/src/win32/w32_util.h
@@ -174,7 +174,7 @@ GIT_INLINE(int) git_win32__file_attribute_to_stat(
/* st_size gets the UTF-8 length of the target name, in bytes,
* not counting the NULL terminator */
if ((st->st_size = git__utf16_to_8(NULL, 0, target)) < 0) {
- giterr_set(GITERR_OS, "Could not convert reparse point name for '%ls'", path);
+ giterr_set(GITERR_OS, "could not convert reparse point name for '%ls'", path);
return -1;
}
}