summaryrefslogtreecommitdiff
path: root/include/git2/buffer.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-12 14:48:24 -0700
committerRussell Belfer <rb@github.com>2013-09-17 09:31:45 -0700
commitb47349b8dc742943e063cb3d755b9db66203e3d9 (patch)
tree8c424b2c07cc7b8cd63e6ef5153ee368036f8446 /include/git2/buffer.h
parent0e32635fcf9a874fe66f871e88c0bbc0511544f1 (diff)
downloadlibgit2-b47349b8dc742943e063cb3d755b9db66203e3d9.tar.gz
Port tests from PR 1683
This ports over some of the tests from https://github.com/libgit2/libgit2/pull/1683 by @yorah and @ethomson
Diffstat (limited to 'include/git2/buffer.h')
-rw-r--r--include/git2/buffer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/git2/buffer.h b/include/git2/buffer.h
index ae8681f13..36a61e6c9 100644
--- a/include/git2/buffer.h
+++ b/include/git2/buffer.h
@@ -55,6 +55,11 @@ typedef struct {
} git_buf;
/**
+ * Static initializer for git_buf from static buffer
+ */
+#define GIT_BUF_INIT_CONST(STR,LEN) { (char *)(STR), 0, (size_t)(LEN) }
+
+/**
* Free the memory referred to by the git_buf.
*
* Note that this does not free the `git_buf` itself, just the memory