Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2012-01-10 03:37:19 +0400
committerRussell Belfer <arrbee@arrbee.com>2012-01-12 02:39:51 +0400
commitdf743c7d3a04553ffc04ae7cbc64fb300e7f61d2 (patch)
tree7f0dfa714ddb292448cbeaa69f2b5d90a3274d85 /src/buffer.h
parent7e443f696068cd8c84a759e532c2845348e5a6ad (diff)
Initial implementation of gitignore support
Adds support for .gitignore files to git_status_foreach() and git_status_file(). This includes refactoring the gitattributes code to share logic where possible. The GIT_STATUS_IGNORED flag will now be passed in for files that are ignored (provided they are not already in the index or the head of repo).
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 52fd9a678..d06358527 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -102,9 +102,16 @@ GIT_INLINE(const char *) git_buf_cstr(git_buf *buf)
return buf->ptr;
}
-
void git_buf_copy_cstr(char *data, size_t datasize, const git_buf *buf);
#define git_buf_PUTS(buf, str) git_buf_put(buf, str, sizeof(str) - 1)
+GIT_INLINE(int) git_buf_rfind_next(git_buf *buf, char ch)
+{
+ int idx = buf->size - 1;
+ while (idx >= 0 && buf->ptr[idx] == ch) idx--;
+ while (idx >= 0 && buf->ptr[idx] != ch) idx--;
+ return idx;
+}
+
#endif