summaryrefslogtreecommitdiff
path: root/src/fileops.h
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2012-02-21 14:46:24 -0800
committerRussell Belfer <arrbee@arrbee.com>2012-02-21 14:46:24 -0800
commitb6c93aef4276051f9c4536ecbed48f4cd093bd1b (patch)
treea15962c672890c0c8cc021dafa7d29487f81c75a /src/fileops.h
parent9c94a356cc61daa85e17c6342db9b3d62f788802 (diff)
downloadlibgit2-b6c93aef4276051f9c4536ecbed48f4cd093bd1b.tar.gz
Uniform iterators for trees, index, and workdir
This create a new git_iterator type of object that provides a uniform interface for iterating over the index, an arbitrary tree, or the working directory of a repository. As part of this, git ignore support was extended to support push and pop of directory-based ignore files as the working directory is being traversed (so the array of ignores does not have to be recreated at each directory during traveral). There are a number of other small utility functions in buffer, path, vector, and fileops that are included in this patch that made the iterator implementation cleaner.
Diffstat (limited to 'src/fileops.h')
-rw-r--r--src/fileops.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/fileops.h b/src/fileops.h
index c9ed05de3..4c114026b 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -85,13 +85,18 @@ extern int git_futils_mktmp(git_buf *path_out, const char *filename);
*/
extern int git_futils_mv_withpath(const char *from, const char *to, const mode_t dirmode);
-
/**
* Get the filesize in bytes of a file
*/
extern git_off_t git_futils_filesize(git_file fd);
/**
+ * Convert a mode_t from the OS to a legal git mode_t value.
+ */
+extern mode_t git_futils_canonical_mode(mode_t raw_mode);
+
+
+/**
* Read-only map all or part of a file into memory.
* When possible this function should favor a virtual memory
* style mapping over some form of malloc()+read(), as the