diff options
Diffstat (limited to 'strbuf.c')
| -rw-r--r-- | strbuf.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1,8 +1,14 @@ #include "cache.h" +#include "abspath.h" +#include "alloc.h" +#include "environment.h" +#include "gettext.h" +#include "hex.h" #include "refs.h" #include "string-list.h" #include "utf8.h" #include "date.h" +#include "wrapper.h" int starts_with(const char *str, const char *prefix) { @@ -1200,3 +1206,9 @@ int strbuf_edit_interactively(struct strbuf *buffer, const char *path, free(path2); return res; } + +void strbuf_strip_file_from_path(struct strbuf *sb) +{ + char *path_sep = find_last_dir_sep(sb->buf); + strbuf_setlen(sb, path_sep ? path_sep - sb->buf + 1 : 0); +} |
