summaryrefslogtreecommitdiff
path: root/include/git2/tree.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-01-09 16:03:35 -0800
committerRussell Belfer <rb@github.com>2013-01-15 09:51:35 -0800
commit98527b5b241ce9d240537f60e87aa9dd084c0f36 (patch)
tree912502b10f4d8ba992647bebff93960c140a303e /include/git2/tree.h
parent23594c1dae08c9a53f571dbf9de7ff0b6a6a0d45 (diff)
downloadlibgit2-98527b5b241ce9d240537f60e87aa9dd084c0f36.tar.gz
Add git_tree_entry_cmp and git_tree_entry_icmp
This adds a new external API git_tree_entry_cmp and a new internal API git_tree_entry_icmp for sorting tree entries. The case insensitive one is internal only because general users should never be seeing case-insensitively sorted trees.
Diffstat (limited to 'include/git2/tree.h')
-rw-r--r--include/git2/tree.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h
index 7726a6599..3861102d9 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -209,6 +209,15 @@ 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);
/**
+ * Compare two tree entries
+ *
+ * @param e1 first tree entry
+ * @param e2 second tree entry
+ * @return <0 if e1 is before e2, 0 if e1 == e2, >0 if e1 is after e2
+ */
+GIT_EXTERN(int) git_tree_entry_cmp(const git_tree_entry *e1, const git_tree_entry *e2);
+
+/**
* Convert a tree entry to the git_object it points too.
*
* You must call `git_object_free()` on the object when you are done with it.