Skip to content

Commit 98303ea

Browse files
authored
Merge pull request libgit2#4457 from libgit2/ethomson/tree_error_messages
tree: standard error messages are lowercase
2 parents 7610638 + 2c99011 commit 98303ea

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/tree.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -440,16 +440,16 @@ int git_tree__parse(void *_tree, git_odb_object *odb_obj)
440440
unsigned int attr;
441441

442442
if (parse_mode(&attr, buffer, &buffer) < 0 || !buffer)
443-
return tree_error("Failed to parse tree. Can't parse filemode", NULL);
443+
return tree_error("failed to parse tree: can't parse filemode", NULL);
444444

445445
if ((nul = memchr(buffer, 0, buffer_end - buffer)) == NULL)
446-
return tree_error("Failed to parse tree. Object is corrupted", NULL);
446+
return tree_error("failed to parse tree: object is corrupted", NULL);
447447

448448
if ((filename_len = nul - buffer) == 0)
449-
return tree_error("Failed to parse tree. Can't parse filename", NULL);
449+
return tree_error("failed to parse tree: can't parse filename", NULL);
450450

451451
if ((buffer_end - (nul + 1)) < GIT_OID_RAWSZ)
452-
return tree_error("Failed to parse tree. Can't parse OID", NULL);
452+
return tree_error("failed to parse tree: can't parse OID", NULL);
453453

454454
/* Allocate the entry */
455455
{
@@ -496,7 +496,7 @@ static int append_entry(
496496
int error = 0;
497497

498498
if (!valid_entry_name(bld->repo, filename))
499-
return tree_error("Failed to insert entry. Invalid name for a tree entry", filename);
499+
return tree_error("failed to insert entry: invalid name for a tree entry", filename);
500500

501501
entry = alloc_entry(filename, strlen(filename), id);
502502
GITERR_CHECK_ALLOC(entry);
@@ -735,14 +735,14 @@ int git_treebuilder_insert(
735735
assert(bld && id && filename);
736736

737737
if (!valid_filemode(filemode))
738-
return tree_error("Failed to insert entry. Invalid filemode for file", filename);
738+
return tree_error("failed to insert entry: invalid filemode for file", filename);
739739

740740
if (!valid_entry_name(bld->repo, filename))
741-
return tree_error("Failed to insert entry. Invalid name for a tree entry", filename);
741+
return tree_error("failed to insert entry: invalid name for a tree entry", filename);
742742

743743
if (filemode != GIT_FILEMODE_COMMIT &&
744744
!git_object__is_valid(bld->repo, id, otype_from_mode(filemode)))
745-
return tree_error("Failed to insert entry; invalid object specified", filename);
745+
return tree_error("failed to insert entry: invalid object specified", filename);
746746

747747
pos = git_strmap_lookup_index(bld->map, filename);
748748
if (git_strmap_valid_index(bld->map, pos)) {
@@ -793,7 +793,7 @@ int git_treebuilder_remove(git_treebuilder *bld, const char *filename)
793793
git_tree_entry *entry = treebuilder_get(bld, filename);
794794

795795
if (entry == NULL)
796-
return tree_error("Failed to remove entry. File isn't in the tree", filename);
796+
return tree_error("failed to remove entry: file isn't in the tree", filename);
797797

798798
git_strmap_delete(bld->map, filename);
799799
git_tree_entry_free(entry);
@@ -946,7 +946,7 @@ int git_tree_entry_bypath(
946946
return GIT_ENOTFOUND;
947947
}
948948

949-
/* If there's only a slash left in the path, we
949+
/* If there's only a slash left in the path, we
950950
* return the current entry; otherwise, we keep
951951
* walking down the path */
952952
if (path[filename_len + 1] != '\0')

0 commit comments

Comments
 (0)