[libgit2-glib/wip/techlivezh/git-diff-find-similar] Initial binding for git_diff_find_similar



commit bf3ba22c45e6f5d5729f5ed8bb002edb0e639702
Author: Techlive Zheng <techlivezheng gmail com>
Date:   Tue Dec 10 02:36:21 2013 +0800

    Initial binding for git_diff_find_similar
    
    Currently, use NULL as git_diff_find_options, which needs binding too.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720127

 libgit2-glib/ggit-diff.c |   25 +++++++++++++++++++++++++
 libgit2-glib/ggit-diff.h |    3 +++
 2 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-diff.c b/libgit2-glib/ggit-diff.c
index 7580d8b..e5cd971 100644
--- a/libgit2-glib/ggit-diff.c
+++ b/libgit2-glib/ggit-diff.c
@@ -315,6 +315,31 @@ ggit_diff_new_tree_to_workdir (GgitRepository   *repository,
 }
 
 /**
+ * ggit_diff_find_similar:
+ * @diff: the #GgitDiff to work on.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Transform a @diff marking file renames, copies, etc.
+ */
+void
+ggit_diff_find_similar (GgitDiff  *diff,
+                        GError   **error)
+{
+       gint ret;
+
+       g_return_if_fail (GGIT_IS_DIFF (diff));
+       g_return_if_fail (error == NULL || *error == NULL);
+
+       ret = git_diff_find_similar (_ggit_native_get (diff),
+                                    NULL);
+
+       if (ret != GIT_OK)
+       {
+               _ggit_error_set (error, ret);
+       }
+}
+
+/**
  * ggit_diff_merge:
  * @onto: the #GgitDiff to merge into.
  * @from: the #GgitDiff to merge.
diff --git a/libgit2-glib/ggit-diff.h b/libgit2-glib/ggit-diff.h
index 169a494..7cbd45e 100644
--- a/libgit2-glib/ggit-diff.h
+++ b/libgit2-glib/ggit-diff.h
@@ -81,6 +81,9 @@ GgitDiff      *ggit_diff_new_tree_to_workdir       (GgitRepository        *repos
                                                     GgitDiffOptions       *diff_options,
                                                     GError               **error);
 
+void           ggit_diff_find_similar              (GgitDiff              *diff,
+                                                    GError               **error);
+
 void           ggit_diff_merge                     (GgitDiff              *onto,
                                                     GgitDiff              *from,
                                                     GError               **error);


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