[libgit2-glib] Update for changes to diff flags in git2



commit c4f100f5499dba35f359a2cc4a912fc79ed5ada3
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sun Mar 3 23:15:34 2013 +0100

    Update for changes to diff flags in git2

 libgit2-glib/ggit-diff-delta.c   |   20 ++++++++++----------
 libgit2-glib/ggit-diff-delta.h   |    2 +-
 libgit2-glib/ggit-diff-file.c    |    6 +++---
 libgit2-glib/ggit-diff-file.h    |    2 +-
 libgit2-glib/ggit-diff-options.c |    2 +-
 libgit2-glib/ggit-diff-options.h |    2 +-
 libgit2-glib/ggit-types.c        |    9 +++------
 libgit2-glib/ggit-types.h        |   29 +++++++++++------------------
 8 files changed, 31 insertions(+), 41 deletions(-)
---
diff --git a/libgit2-glib/ggit-diff-delta.c b/libgit2-glib/ggit-diff-delta.c
index 982a4e9..0031ef2 100644
--- a/libgit2-glib/ggit-diff-delta.c
+++ b/libgit2-glib/ggit-diff-delta.c
@@ -31,8 +31,8 @@ struct _GgitDiffDelta {
        GgitDiffFile *old_file;
        GgitDiffFile *new_file;
        GgitDeltaType status;
-       guint similarity;
-       gint binary;
+       guint32 similarity;
+       guint32 flags;
 };
 
 G_DEFINE_BOXED_TYPE (GgitDiffDelta, ggit_diff_delta,
@@ -51,7 +51,7 @@ _ggit_diff_delta_wrap (const git_diff_delta *delta)
        gdelta->new_file = _ggit_diff_file_wrap (&delta->new_file);
        gdelta->status = delta->status;
        gdelta->similarity = delta->similarity;
-       gdelta->binary = delta->binary;
+       gdelta->flags = delta->flags;
 
        return gdelta;
 }
@@ -160,19 +160,19 @@ ggit_diff_delta_get_similarity (GgitDiffDelta *delta)
 }
 
 /**
- * ggit_diff_delta_get_binary:
+ * ggit_diff_delta_get_flags:
  * @delta: a #GgitDiffDelta.
  *
- * Gets if @delta is binary.
+ * Gets flags for @delta.
  *
- * Returns: 0 if not binary, 1 if binary and -1 if unknown.
+ * Returns: the delta flags
  */
-gint
-ggit_diff_delta_get_binary (GgitDiffDelta *delta)
+GgitDiffFlag
+ggit_diff_delta_get_flags (GgitDiffDelta *delta)
 {
-       g_return_val_if_fail (delta != NULL, -1);
+       g_return_val_if_fail (delta != NULL, 0);
 
-       return delta->binary;
+       return delta->flags;
 }
 
 /* ex:set ts=8 noet: */
diff --git a/libgit2-glib/ggit-diff-delta.h b/libgit2-glib/ggit-diff-delta.h
index 66abdef..d0d7432 100644
--- a/libgit2-glib/ggit-diff-delta.h
+++ b/libgit2-glib/ggit-diff-delta.h
@@ -41,7 +41,7 @@ GgitDiffFile   *ggit_diff_delta_get_old_file   (GgitDiffDelta        *delta);
 GgitDiffFile   *ggit_diff_delta_get_new_file   (GgitDiffDelta        *delta);
 GgitDeltaType   ggit_diff_delta_get_status     (GgitDiffDelta        *delta);
 guint           ggit_diff_delta_get_similarity (GgitDiffDelta        *delta);
-gint            ggit_diff_delta_get_binary     (GgitDiffDelta        *delta);
+GgitDiffFlag    ggit_diff_delta_get_flags      (GgitDiffDelta        *delta);
 
 G_END_DECLS
 
diff --git a/libgit2-glib/ggit-diff-file.c b/libgit2-glib/ggit-diff-file.c
index 72c5d06..208d560 100644
--- a/libgit2-glib/ggit-diff-file.c
+++ b/libgit2-glib/ggit-diff-file.c
@@ -31,7 +31,7 @@ struct _GgitDiffFile {
        gchar *path;
        guint16 mode;
        gint64 size;
-       GgitDiffFileFlags flags;
+       GgitDiffFlag flags;
 };
 
 G_DEFINE_BOXED_TYPE (GgitDiffFile, ggit_diff_file,
@@ -162,11 +162,11 @@ ggit_diff_file_get_size (GgitDiffFile *file)
  * ggit_diff_file_get_flags:
  * @file: a #GgitDiffFile.
  *
- * Gets the #GgitDiffFileFlags for @file.
+ * Gets the #GgitDifflags for @file.
  *
  * Returns: the file's flags.
  */
-GgitDiffFileFlags
+GgitDiffFlag
 ggit_diff_file_get_flags (GgitDiffFile *file)
 {
        g_return_val_if_fail (file != NULL, 0);
diff --git a/libgit2-glib/ggit-diff-file.h b/libgit2-glib/ggit-diff-file.h
index a7670c8..4950599 100644
--- a/libgit2-glib/ggit-diff-file.h
+++ b/libgit2-glib/ggit-diff-file.h
@@ -41,7 +41,7 @@ GgitOId           *ggit_diff_file_get_oid   (GgitDiffFile        *file);
 const gchar       *ggit_diff_file_get_path  (GgitDiffFile        *file);
 guint16            ggit_diff_file_get_mode  (GgitDiffFile        *file);
 gint64             ggit_diff_file_get_size  (GgitDiffFile        *file);
-GgitDiffFileFlags  ggit_diff_file_get_flags (GgitDiffFile        *file);
+GgitDiffFlag       ggit_diff_file_get_flags (GgitDiffFile        *file);
 
 G_END_DECLS
 
diff --git a/libgit2-glib/ggit-diff-options.c b/libgit2-glib/ggit-diff-options.c
index 851974d..7c2e274 100644
--- a/libgit2-glib/ggit-diff-options.c
+++ b/libgit2-glib/ggit-diff-options.c
@@ -113,7 +113,7 @@ ggit_diff_options_free (GgitDiffOptions *diff_options)
  * Returns: a newly allocated #GgitDiffOptions.
  */
 GgitDiffOptions *
-ggit_diff_options_new (GgitDiffFlags   flags,
+ggit_diff_options_new (GgitDiffOption  flags,
                        gint            n_context_lines,
                        gint            n_interhunk_lines,
                        const gchar    *old_prefix,
diff --git a/libgit2-glib/ggit-diff-options.h b/libgit2-glib/ggit-diff-options.h
index 70b1d0e..9ae3435 100644
--- a/libgit2-glib/ggit-diff-options.h
+++ b/libgit2-glib/ggit-diff-options.h
@@ -39,7 +39,7 @@ const git_diff_options *_ggit_diff_options_get_diff_options (GgitDiffOptions
 GgitDiffOptions        *ggit_diff_options_copy              (GgitDiffOptions        *diff_options);
 void                    ggit_diff_options_free              (GgitDiffOptions        *diff_options);
 
-GgitDiffOptions        *ggit_diff_options_new               (GgitDiffFlags           flags,
+GgitDiffOptions        *ggit_diff_options_new               (GgitDiffOption          flags,
                                                              gint                    n_context_lines,
                                                              gint                    n_interhunk_lines,
                                                              const gchar            *old_prefix,
diff --git a/libgit2-glib/ggit-types.c b/libgit2-glib/ggit-types.c
index 5d91ae1..4255029 100644
--- a/libgit2-glib/ggit-types.c
+++ b/libgit2-glib/ggit-types.c
@@ -68,12 +68,9 @@ ASSERT_ENUM (GGIT_DIFF_INCLUDE_UNMODIFIED,       GIT_DIFF_INCLUDE_UNMODIFIED);
 ASSERT_ENUM (GGIT_DIFF_RECURSE_UNTRACKED_DIRS,   GIT_DIFF_RECURSE_UNTRACKED_DIRS);
 
 
-ASSERT_ENUM (GGIT_DIFF_FILE_VALID_OID,  GIT_DIFF_FILE_VALID_OID);
-ASSERT_ENUM (GGIT_DIFF_FILE_FREE_PATH,  GIT_DIFF_FILE_FREE_PATH);
-ASSERT_ENUM (GGIT_DIFF_FILE_BINARY,     GIT_DIFF_FILE_BINARY);
-ASSERT_ENUM (GGIT_DIFF_FILE_NOT_BINARY, GIT_DIFF_FILE_NOT_BINARY);
-ASSERT_ENUM (GGIT_DIFF_FILE_FREE_DATA,  GIT_DIFF_FILE_FREE_DATA);
-ASSERT_ENUM (GGIT_DIFF_FILE_UNMAP_DATA, GIT_DIFF_FILE_UNMAP_DATA);
+ASSERT_ENUM (GGIT_DIFF_FLAG_VALID_OID,  GIT_DIFF_FLAG_VALID_OID);
+ASSERT_ENUM (GGIT_DIFF_FLAG_BINARY,     GIT_DIFF_FLAG_BINARY);
+ASSERT_ENUM (GGIT_DIFF_FLAG_NOT_BINARY, GIT_DIFF_FLAG_NOT_BINARY);
 
 
 ASSERT_ENUM (GGIT_DIFF_LINE_CONTEXT,   GIT_DIFF_LINE_CONTEXT);
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index 50875fa..30609d2 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -258,7 +258,6 @@ typedef struct _GgitTree GgitTree;
 typedef struct _GgitTreeEntry GgitTreeEntry;
 
 
-
 /**
  * GgitBranchType:
  * @GGIT_BRANCH_LOCAL: specifies a local branch.
@@ -331,7 +330,7 @@ typedef enum {
 } GgitDeltaType;
 
 /**
- * GgitDiffFlags:
+ * GgitDiffOption:
  * @GGIT_DIFF_NORMAL: normal.
  * @GGIT_DIFF_REVERSE: reverse.
  * @GGIT_DIFF_FORCE_TEXT: force text.
@@ -360,27 +359,21 @@ typedef enum {
        GGIT_DIFF_INCLUDE_UNTRACKED        = 1 << 8,
        GGIT_DIFF_INCLUDE_UNMODIFIED       = 1 << 9,
        GGIT_DIFF_RECURSE_UNTRACKED_DIRS   = 1 << 10
-} GgitDiffFlags;
+} GgitDiffOption;
 
 /**
- * GgitDiffFileFlags:
- * @GGIT_DIFF_FILE_VALID_OID: if the OID is valid.
- * @GGIT_DIFF_FILE_FREE_PATH: if the path must be freed (libgit2 internal).
- * @GGIT_DIFF_FILE_BINARY: if the file is binary.
- * @GGIT_DIFF_FILE_NOT_BINARY: if the file is not binary.
- * @GGIT_DIFF_FILE_FREE_DATA: if the data must be freed (libgit2 internal).
- * @GGIT_DIFF_FILE_UNMAP_DATA: if the data must be unmapped (libgit2 internal).
+ * GgitDiffFlag:
+ * @GGIT_DIFF_VALID_OID: if the OID is valid.
+ * @GGIT_DIFF_BINARY: if the file is binary.
+ * @GGIT_DIFF_NOT_BINARY: if the file is not binary.
  *
- * Describes the diff file.
+ * Describes the diff file and/or delta flags
  */
 typedef enum {
-       GGIT_DIFF_FILE_VALID_OID  = 1 << 0,
-       GGIT_DIFF_FILE_FREE_PATH  = 1 << 1,
-       GGIT_DIFF_FILE_BINARY     = 1 << 2,
-       GGIT_DIFF_FILE_NOT_BINARY = 1 << 3,
-       GGIT_DIFF_FILE_FREE_DATA  = 1 << 4,
-       GGIT_DIFF_FILE_UNMAP_DATA = 1 << 5
-} GgitDiffFileFlags;
+       GGIT_DIFF_FLAG_BINARY     = 1 << 0,
+       GGIT_DIFF_FLAG_NOT_BINARY = 1 << 1,
+       GGIT_DIFF_FLAG_VALID_OID  = 1 << 2
+} GgitDiffFlag;
 
 /**
  * GgitDiffLineType:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]