[libgit2-glib] ggit_tree_entry_get_attributes renamed as get_file_mode
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] ggit_tree_entry_get_attributes renamed as get_file_mode
- Date: Sat, 29 Sep 2012 11:50:29 +0000 (UTC)
commit 03914c4fa4bf429bde57a7a0950381825899e812
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sat Sep 29 13:49:31 2012 +0200
ggit_tree_entry_get_attributes renamed as get_file_mode
libgit2-glib/ggit-tree-entry.c | 13 ++++++-------
libgit2-glib/ggit-tree-entry.h | 2 +-
libgit2-glib/ggit-types.c | 7 +++++++
libgit2-glib/ggit-types.h | 10 ++++++++++
4 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/libgit2-glib/ggit-tree-entry.c b/libgit2-glib/ggit-tree-entry.c
index 29bc7cf..6524f3a 100644
--- a/libgit2-glib/ggit-tree-entry.c
+++ b/libgit2-glib/ggit-tree-entry.c
@@ -83,20 +83,19 @@ ggit_tree_entry_unref (GgitTreeEntry *entry)
}
/**
- * ggit_tree_entry_get_attributes:
+ * ggit_tree_entry_get_file_mode:
* @entry: a #GgitTreeEntry.
*
- * Get the attributes of the tree entry.
- *
- * Returns: attributes of the tree entry.
+ * Get the UNIX file attributes of a tree entry.
*
+ * Returns: the UNIX file attributes of a tree entry.
**/
-guint
-ggit_tree_entry_get_attributes (GgitTreeEntry *entry)
+GgitFileMode
+ggit_tree_entry_get_file_mode (GgitTreeEntry *entry)
{
g_return_val_if_fail (entry != NULL, 0);
- return git_tree_entry_attributes (entry->entry);
+ return git_tree_entry_filemode (entry->entry);
}
/**
diff --git a/libgit2-glib/ggit-tree-entry.h b/libgit2-glib/ggit-tree-entry.h
index 9a2221c..e469225 100644
--- a/libgit2-glib/ggit-tree-entry.h
+++ b/libgit2-glib/ggit-tree-entry.h
@@ -36,7 +36,7 @@ GgitTreeEntry *_ggit_tree_entry_new (const git_tree_entry *entry);
GgitTreeEntry *ggit_tree_entry_ref (GgitTreeEntry *entry);
void ggit_tree_entry_unref (GgitTreeEntry *entry);
-guint ggit_tree_entry_get_attributes (GgitTreeEntry *entry);
+GgitFileMode ggit_tree_entry_get_file_mode (GgitTreeEntry *entry);
GgitOId *ggit_tree_entry_get_id (GgitTreeEntry *entry);
const gchar * ggit_tree_entry_get_name (GgitTreeEntry *entry);
diff --git a/libgit2-glib/ggit-types.c b/libgit2-glib/ggit-types.c
index 0a04123..2d96b6c 100644
--- a/libgit2-glib/ggit-types.c
+++ b/libgit2-glib/ggit-types.c
@@ -86,6 +86,13 @@ ASSERT_ENUM (GGIT_ERROR_BUFS, GIT_EBUFS);
ASSERT_ENUM (GGIT_ERROR_PASSTHROUGH, GIT_PASSTHROUGH);
ASSERT_ENUM (GGIT_ERROR_ITEROVER, GIT_ITEROVER);
+ASSERT_ENUM (GGIT_FILEMODE_NEW, GIT_FILEMODE_NEW);
+ASSERT_ENUM (GGIT_FILEMODE_TREE, GIT_FILEMODE_TREE);
+ASSERT_ENUM (GGIT_FILEMODE_BLOB, GIT_FILEMODE_BLOB);
+ASSERT_ENUM (GGIT_FILEMODE_BLOB_EXECUTABLE, GIT_FILEMODE_BLOB_EXECUTABLE);
+ASSERT_ENUM (GGIT_FILEMODE_LINK, GIT_FILEMODE_LINK);
+ASSERT_ENUM (GGIT_FILEMODE_COMMIT, GIT_FILEMODE_COMMIT);
+
ASSERT_ENUM (GGIT_REF_INVALID, GIT_REF_INVALID);
ASSERT_ENUM (GGIT_REF_OID, GIT_REF_OID);
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index e4c208a..ae33529 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -398,6 +398,16 @@ typedef enum {
} GgitError;
/* NOTE: keep in sync with git2/refs.h */
+typedef enum {
+ GGIT_FILEMODE_NEW = 0000000,
+ GGIT_FILEMODE_TREE = 0040000,
+ GGIT_FILEMODE_BLOB = 0100644,
+ GGIT_FILEMODE_BLOB_EXECUTABLE = 0100755,
+ GGIT_FILEMODE_LINK = 0120000,
+ GGIT_FILEMODE_COMMIT = 0160000
+} GgitFileMode;
+
+/* NOTE: keep in sync with git2/refs.h */
/**
* GgitRefType:
* @GGIT_REF_INVALID: An invalid reference.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]