summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-05-16 11:10:42 -0700
committerVicent Martí <vicent@github.com>2013-05-16 11:10:42 -0700
commitc2d282cfd88ffba7693113786bd2209a5d38b964 (patch)
tree86da1c83c4ebb442f860147487c488659301d8bb /include
parent18e37db9359bc5e109702eec7422b95fac21b106 (diff)
parent8d78400142bc001e18e0b0687290d6b446e05130 (diff)
downloadlibgit2-c2d282cfd88ffba7693113786bd2209a5d38b964.tar.gz
Merge pull request #1590 from arrbee/examples-like-git
Add cat-file to examples (with some public API improvements)
Diffstat (limited to 'include')
-rw-r--r--include/git2/commit.h9
-rw-r--r--include/git2/tree.h6
2 files changed, 10 insertions, 5 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h
index a420ba635..20b345f84 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -164,7 +164,10 @@ GIT_EXTERN(unsigned int) git_commit_parentcount(const git_commit *commit);
* @param n the position of the parent (from 0 to `parentcount`)
* @return 0 or an error code
*/
-GIT_EXTERN(int) git_commit_parent(git_commit **out, git_commit *commit, unsigned int n);
+GIT_EXTERN(int) git_commit_parent(
+ git_commit **out,
+ const git_commit *commit,
+ unsigned int n);
/**
* Get the oid of a specified parent for a commit. This is different from
@@ -175,7 +178,9 @@ GIT_EXTERN(int) git_commit_parent(git_commit **out, git_commit *commit, unsigned
* @param n the position of the parent (from 0 to `parentcount`)
* @return the id of the parent, NULL on error.
*/
-GIT_EXTERN(const git_oid *) git_commit_parent_id(git_commit *commit, unsigned int n);
+GIT_EXTERN(const git_oid *) git_commit_parent_id(
+ const git_commit *commit,
+ unsigned int n);
/**
* Get the commit object that is the <n>th generation ancestor
diff --git a/include/git2/tree.h b/include/git2/tree.h
index 6ad722048..d673f50c4 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -97,7 +97,7 @@ GIT_EXTERN(size_t) git_tree_entrycount(const git_tree *tree);
* @return the tree entry; NULL if not found
*/
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(
- git_tree *tree, const char *filename);
+ const git_tree *tree, const char *filename);
/**
* Lookup a tree entry by its position in the tree
@@ -110,7 +110,7 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(
* @return the tree entry; NULL if not found
*/
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(
- git_tree *tree, size_t idx);
+ const git_tree *tree, size_t idx);
/**
* Lookup a tree entry by SHA value.
@@ -141,7 +141,7 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byoid(
*/
GIT_EXTERN(int) git_tree_entry_bypath(
git_tree_entry **out,
- git_tree *root,
+ const git_tree *root,
const char *path);
/**