X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2Fpathspec.c;h=3e44643c6759a89443a65baae10f249482621f31;hb=e579e0f70726f20d8b946b256f6cf90efdbf7d9a;hp=c6ad16571ecaad30d5008d98d152ed8186286fbe;hpb=c25aa7cd825ba972c2a1a902c73ce3a8c8a59ec3;p=libgit2.git diff --git a/src/pathspec.c b/src/pathspec.c index c6ad16571..3e44643c6 100644 --- a/src/pathspec.c +++ b/src/pathspec.c @@ -20,11 +20,11 @@ /* what is the common non-wildcard prefix for all items in the pathspec */ char *git_pathspec_prefix(const git_strarray *pathspec) { - git_buf prefix = GIT_BUF_INIT; + git_str prefix = GIT_STR_INIT; const char *scan; if (!pathspec || !pathspec->count || - git_buf_common_prefix(&prefix, pathspec->strings, pathspec->count) < 0) + git_str_common_prefix(&prefix, pathspec->strings, pathspec->count) < 0) return NULL; /* diff prefix will only be leading non-wildcards */ @@ -33,16 +33,16 @@ char *git_pathspec_prefix(const git_strarray *pathspec) (scan == prefix.ptr || (*(scan - 1) != '\\'))) break; } - git_buf_truncate(&prefix, scan - prefix.ptr); + git_str_truncate(&prefix, scan - prefix.ptr); if (prefix.size <= 0) { - git_buf_dispose(&prefix); + git_str_dispose(&prefix); return NULL; } - git_buf_unescape(&prefix); + git_str_unescape(&prefix); - return git_buf_detach(&prefix); + return git_str_detach(&prefix); } /* is there anything in the spec that needs to be filtered on */