]> git.ipfire.org Git - thirdparty/git.git/blobdiff - strbuf.c
object-name.h: move declarations for object-name.c functions from cache.h
[thirdparty/git.git] / strbuf.c
index 0890b1405c5cc6888396bac8558549ebdb2e2977..1b93d9d3c4741003c346891cfeb04c313192ef88 100644 (file)
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,8 +1,15 @@
 #include "cache.h"
+#include "abspath.h"
+#include "alloc.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.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 +1207,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);
+}