summaryrefslogtreecommitdiff
path: root/include/git2/tree.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-04-15 09:07:57 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-10-08 10:07:31 +0200
commit13f670a5d9d86629f4879f6df9494356e4f28832 (patch)
tree2a09d4df939f555c5c43a1f26c944dc02c8e0219 /include/git2/tree.h
parent711333efe1c1388c39cd76480273b4fcea18d491 (diff)
downloadlibgit2-13f670a5d9d86629f4879f6df9494356e4f28832.tar.gz
tree: allow retrieval of raw attributes
When a tool needs to recreate the tree object (for example an interface to another VCS), it needs to use the raw attributes, forgoing any normalization.
Diffstat (limited to 'include/git2/tree.h')
-rw-r--r--include/git2/tree.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h
index f1e7d0899..d94b446c2 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -199,6 +199,17 @@ GIT_EXTERN(git_otype) git_tree_entry_type(const git_tree_entry *entry);
GIT_EXTERN(git_filemode_t) git_tree_entry_filemode(const git_tree_entry *entry);
/**
+ * Get the raw UNIX file attributes of a tree entry
+ *
+ * This function does not perform any normalization and is only useful
+ * if you need to be able to recreate the original tree object.
+ *
+ * @param entry a tree entry
+ * @return filemode as an integer
+ */
+
+GIT_EXTERN(git_filemode_t) git_tree_entry_filemode_raw(const git_tree_entry *entry);
+/**
* Compare two tree entries
*
* @param e1 first tree entry