[libgit2-glib] Properly initialize git2 diff options struct
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Properly initialize git2 diff options struct
- Date: Wed, 3 Jul 2013 12:07:32 +0000 (UTC)
commit a68f66f0d892e27125c9a1d72ccd67f22d6c72db
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Wed Jul 3 13:59:52 2013 +0200
Properly initialize git2 diff options struct
libgit2-glib/ggit-diff-options.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/libgit2-glib/ggit-diff-options.c b/libgit2-glib/ggit-diff-options.c
index b1ff684..a3b1ac0 100644
--- a/libgit2-glib/ggit-diff-options.c
+++ b/libgit2-glib/ggit-diff-options.c
@@ -121,19 +121,20 @@ ggit_diff_options_new (GgitDiffOption flags,
const gchar **pathspec)
{
GgitDiffOptions *diff_options;
- git_diff_options *gdiff_options;
+ git_diff_options gdiff_options = GIT_DIFF_OPTIONS_INIT;
diff_options = g_slice_new (GgitDiffOptions);
- gdiff_options = &diff_options->diff_options;
- gdiff_options->flags = flags;
- gdiff_options->context_lines = n_context_lines;
- gdiff_options->interhunk_lines = n_interhunk_lines;
- gdiff_options->old_prefix = old_prefix == NULL ? NULL : g_strdup (old_prefix);
- gdiff_options->new_prefix = new_prefix == NULL ? NULL : g_strdup (new_prefix);
+ gdiff_options.flags = flags;
+ gdiff_options.context_lines = n_context_lines;
+ gdiff_options.interhunk_lines = n_interhunk_lines;
+ gdiff_options.old_prefix = old_prefix == NULL ? NULL : g_strdup (old_prefix);
+ gdiff_options.new_prefix = new_prefix == NULL ? NULL : g_strdup (new_prefix);
+
ggit_utils_get_git_strarray_from_str_array (pathspec,
- &gdiff_options->pathspec);
+ &gdiff_options.pathspec);
+ diff_options->diff_options = gdiff_options;
return diff_options;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]