tree: add more correct error messages for not found

Don't use the full path, as that's not what we are asserting does not
exist, but just the subpath we were looking up.
This commit is contained in:
Carlos Martín Nieto 2015-03-12 01:49:07 +01:00
parent a61fa4c0c7
commit 84511143fd

View File

@ -858,7 +858,7 @@ int git_tree_entry_bypath(
if (entry == NULL) {
giterr_set(GITERR_TREE,
"The path '%s' does not exist in the given tree", path);
"the path '%.*s' does not exist in the given tree", filename_len, path);
return GIT_ENOTFOUND;
}
@ -868,7 +868,7 @@ int git_tree_entry_bypath(
* then this entry *must* be a tree */
if (!git_tree_entry__is_tree(entry)) {
giterr_set(GITERR_TREE,
"The path '%s' does not exist in the given tree", path);
"the path '%.*s' exists but is not a tree", filename_len, path);
return GIT_ENOTFOUND;
}