[libgit2-glib] Bind ggit_branch_get_name
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Bind ggit_branch_get_name
- Date: Fri, 15 Mar 2013 15:32:10 +0000 (UTC)
commit 0cfa9cb151af54752760beb26e935886094d21a9
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Fri Mar 15 16:31:53 2013 +0100
Bind ggit_branch_get_name
libgit2-glib/ggit-branch.c | 33 +++++++++++++++++++++++++++++++++
libgit2-glib/ggit-branch.h | 3 +++
2 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-branch.c b/libgit2-glib/ggit-branch.c
index 57f9edc..2da9eeb 100644
--- a/libgit2-glib/ggit-branch.c
+++ b/libgit2-glib/ggit-branch.c
@@ -114,6 +114,37 @@ ggit_branch_move (GgitBranch *branch,
}
/**
+ * ggit_branch_get_name:
+ * @branch: a #GgitBranch.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Gets the name of the given local or remote branch.
+ *
+ * Returns: the name of the given local or remote branch.
+ */
+const gchar *
+ggit_branch_get_name (GgitBranch *branch,
+ GError **error)
+{
+ const gchar *out;
+ gint ret;
+
+ g_return_val_if_fail (GGIT_IS_BRANCH (branch), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ ret = git_branch_name (&out,
+ _ggit_native_get (branch));
+
+ if (ret != GIT_OK)
+ {
+ _ggit_error_set (error, ret);
+ return NULL;
+ }
+
+ return out;
+}
+
+/**
* ggit_branch_get_tracking:
* @branch: a #GgitBranch.
* @error: a #GError for error reporting, or %NULL.
@@ -145,4 +176,6 @@ ggit_branch_get_tracking (GgitBranch *branch,
return _ggit_branch_wrap (tracking);
}
+
+
/* ex:set ts=8 noet: */
diff --git a/libgit2-glib/ggit-branch.h b/libgit2-glib/ggit-branch.h
index 47c6ccb..7ff4e39 100644
--- a/libgit2-glib/ggit-branch.h
+++ b/libgit2-glib/ggit-branch.h
@@ -61,6 +61,9 @@ GgitBranch *ggit_branch_move (GgitBranch *branch,
GgitCreateFlags flags,
GError **error);
+const gchar *ggit_branch_get_name (GgitBranch *branch,
+ GError **error);
+
GgitBranch *ggit_branch_get_tracking (GgitBranch *branch,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]