diff options
Diffstat (limited to 'strbuf.c')
| -rw-r--r-- | strbuf.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,4 +1,6 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "alloc.h" +#include "hex.h" #include "refs.h" #include "string-list.h" #include "utf8.h" @@ -1200,3 +1202,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); +} |
