summaryrefslogtreecommitdiff
path: root/include/git2/revparse.h
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-04-15 11:42:34 -0700
committerBen Straub <bs@github.com>2013-04-15 11:42:34 -0700
commit4291ad078128003ad6d4ac6fb58244f3343ad87a (patch)
tree639ec6492b4333a211898d06594b3cd94619b69a /include/git2/revparse.h
parentec7e240ba4a3277a94def51005d2558d02cb8c3c (diff)
downloadlibgit2-4291ad078128003ad6d4ac6fb58244f3343ad87a.tar.gz
Reintroduce git_revparse_single.
Diffstat (limited to 'include/git2/revparse.h')
-rw-r--r--include/git2/revparse.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/git2/revparse.h b/include/git2/revparse.h
index 7fe910b45..2bbbaa5e1 100644
--- a/include/git2/revparse.h
+++ b/include/git2/revparse.h
@@ -20,6 +20,20 @@
*/
GIT_BEGIN_DECL
+/**
+ *
+ * Find a single object, as specified by a revision string. See `man gitrevisions`,
+ * or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for
+ * information on the syntax accepted.
+ *
+ * @param out pointer to output object
+ * @param repo the repository to search in
+ * @param spec the textual specification for an object
+ * @return 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC or an error code
+ */
+GIT_EXTERN(int) git_revparse_single(git_object **out, git_repository *repo,
+ const char *spec);
+
/**
* Revparse flags. These indicate the intended behavior of the spec passed to