]> git.ipfire.org Git - thirdparty/git.git/blobdiff - strbuf.h
refs: print error message in debug output
[thirdparty/git.git] / strbuf.h
index 5b1113abf8fccd49c936ed3fb5fe5d9e5dc774aa..76965a17d444829b4a5b5edc099d12bf1fcc7ea3 100644 (file)
--- a/strbuf.h
+++ b/strbuf.h
@@ -70,7 +70,7 @@ struct strbuf {
 };
 
 extern char strbuf_slopbuf[];
-#define STRBUF_INIT  { .alloc = 0, .len = 0, .buf = strbuf_slopbuf }
+#define STRBUF_INIT  { .buf = strbuf_slopbuf }
 
 /*
  * Predeclare this here, since cache.h includes this file before it defines the
@@ -160,7 +160,7 @@ void strbuf_grow(struct strbuf *sb, size_t amount);
 static inline void strbuf_setlen(struct strbuf *sb, size_t len)
 {
        if (len > (sb->alloc ? sb->alloc - 1 : 0))
-               die("BUG: strbuf_setlen() beyond buffer");
+               BUG("strbuf_setlen() beyond buffer");
        sb->len = len;
        if (sb->buf != strbuf_slopbuf)
                sb->buf[len] = '\0';
@@ -634,8 +634,10 @@ void strbuf_list_free(struct strbuf **list);
  * Add the abbreviation, as generated by find_unique_abbrev, of `sha1` to
  * the strbuf `sb`.
  */
-void strbuf_add_unique_abbrev(struct strbuf *sb,
-                             const struct object_id *oid,
+struct repository;
+void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
+                                  const struct object_id *oid, int abbrev_len);
+void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
                              int abbrev_len);
 
 /**