/* gitg-commit-action-create-patch.c generated by valac 0.32.1, the Vala compiler
 * generated from gitg-commit-action-create-patch.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2014 - Jesse van den Kieboom
 *
 * gitg is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * gitg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include "libgitg-ext/libgitg-ext.h"
#include "libgitg/libgitg.h"
#include <libgit2-glib/ggit.h>
#include <stdlib.h>
#include <string.h>
#include <config.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <stdio.h>


#define GITG_TYPE_COMMIT_ACTION_CREATE_PATCH (gitg_commit_action_create_patch_get_type ())
#define GITG_COMMIT_ACTION_CREATE_PATCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatch))
#define GITG_COMMIT_ACTION_CREATE_PATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatchClass))
#define GITG_IS_COMMIT_ACTION_CREATE_PATCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH))
#define GITG_IS_COMMIT_ACTION_CREATE_PATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH))
#define GITG_COMMIT_ACTION_CREATE_PATCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatchClass))

typedef struct _GitgCommitActionCreatePatch GitgCommitActionCreatePatch;
typedef struct _GitgCommitActionCreatePatchClass GitgCommitActionCreatePatchClass;
typedef struct _GitgCommitActionCreatePatchPrivate GitgCommitActionCreatePatchPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define __vala_GgitOId_free0(var) ((var == NULL) ? NULL : (var = (_vala_GgitOId_free (var), NULL)))
typedef struct _Block37Data Block37Data;

struct _GitgCommitActionCreatePatch {
	GObject parent_instance;
	GitgCommitActionCreatePatchPrivate * priv;
};

struct _GitgCommitActionCreatePatchClass {
	GObjectClass parent_class;
};

struct _GitgCommitActionCreatePatchPrivate {
	GitgExtApplication* _application;
	GitgExtRefActionInterface* _action_interface;
	GitgCommit* _commit;
	GgitDiff* _diff;
};

struct _Block37Data {
	int _ref_count_;
	GitgCommitActionCreatePatch* self;
	GtkFileChooserDialog* chooser;
};


static gpointer gitg_commit_action_create_patch_parent_class = NULL;
static GRegex* gitg_commit_action_create_patch_s_subject_regex;
static GRegex* gitg_commit_action_create_patch_s_subject_regex = NULL;
static GitgExtUIElementIface* gitg_commit_action_create_patch_gitg_ext_ui_element_parent_iface = NULL;
static GitgExtActionIface* gitg_commit_action_create_patch_gitg_ext_action_parent_iface = NULL;
static GitgExtCommitActionIface* gitg_commit_action_create_patch_gitg_ext_commit_action_parent_iface = NULL;

GType gitg_commit_action_create_patch_get_type (void) G_GNUC_CONST;
#define GITG_COMMIT_ACTION_CREATE_PATCH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatchPrivate))
enum  {
	GITG_COMMIT_ACTION_CREATE_PATCH_DUMMY_PROPERTY,
	GITG_COMMIT_ACTION_CREATE_PATCH_APPLICATION,
	GITG_COMMIT_ACTION_CREATE_PATCH_ACTION_INTERFACE,
	GITG_COMMIT_ACTION_CREATE_PATCH_COMMIT,
	GITG_COMMIT_ACTION_CREATE_PATCH_DIFF,
	GITG_COMMIT_ACTION_CREATE_PATCH_ID,
	GITG_COMMIT_ACTION_CREATE_PATCH_DISPLAY_NAME,
	GITG_COMMIT_ACTION_CREATE_PATCH_DESCRIPTION
};
#define GITG_COMMIT_ACTION_CREATE_PATCH_version VERSION
GitgCommitActionCreatePatch* gitg_commit_action_create_patch_new (GitgExtApplication* application, GitgExtRefActionInterface* action_interface, GitgCommit* commit);
GitgCommitActionCreatePatch* gitg_commit_action_create_patch_construct (GType object_type, GitgExtApplication* application, GitgExtRefActionInterface* action_interface, GitgCommit* commit);
static gchar* gitg_commit_action_create_patch_patch_filename (GitgCommitActionCreatePatch* self, gint i);
static GgitDiff* gitg_commit_action_create_patch_create_diff_from_commit (GitgCommitActionCreatePatch* self, GError** error);
static void gitg_commit_action_create_patch_create_patch (GitgCommitActionCreatePatch* self, GFile* file, GError** error);
GgitDiff* gitg_commit_action_create_patch_get_diff (GitgCommitActionCreatePatch* self);
void gitg_commit_action_create_patch_set_diff (GitgCommitActionCreatePatch* self, GgitDiff* value);
static void _vala_GgitOId_free (GgitOId* self);
static void gitg_commit_action_create_patch_real_activate (GitgExtUIElement* base);
static Block37Data* block37_data_ref (Block37Data* _data37_);
static void block37_data_unref (void * _userdata_);
static void __lambda154_ (Block37Data* _data37_, GtkDialog* dialog, gint id);
static void ___lambda154__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void gitg_commit_action_create_patch_finalize (GObject* obj);
static void _vala_gitg_commit_action_create_patch_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gitg_commit_action_create_patch_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


GitgCommitActionCreatePatch* gitg_commit_action_create_patch_construct (GType object_type, GitgExtApplication* application, GitgExtRefActionInterface* action_interface, GitgCommit* commit) {
	GitgCommitActionCreatePatch * self = NULL;
	GitgExtApplication* _tmp0_ = NULL;
	GitgExtRefActionInterface* _tmp1_ = NULL;
	GitgCommit* _tmp2_ = NULL;
#line 47 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_val_if_fail (application != NULL, NULL);
#line 47 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_val_if_fail (action_interface != NULL, NULL);
#line 47 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_val_if_fail (commit != NULL, NULL);
#line 51 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = application;
#line 51 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = action_interface;
#line 51 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp2_ = commit;
#line 51 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) g_object_new (object_type, "application", _tmp0_, "action-interface", _tmp1_, "commit", _tmp2_, NULL);
#line 47 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return self;
#line 137 "gitg-commit-action-create-patch.c"
}


GitgCommitActionCreatePatch* gitg_commit_action_create_patch_new (GitgExtApplication* application, GitgExtRefActionInterface* action_interface, GitgCommit* commit) {
#line 47 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return gitg_commit_action_create_patch_construct (GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, application, action_interface, commit);
#line 144 "gitg-commit-action-create-patch.c"
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
#line 1380 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1380 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1380 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 157 "gitg-commit-action-create-patch.c"
	{
		GRegex* regex = NULL;
		const gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		GRegex* _tmp3_ = NULL;
		GRegex* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		GRegex* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp0_ = old;
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp2_ = _tmp1_;
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp4_ = _tmp3_;
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_g_free0 (_tmp2_);
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		regex = _tmp4_;
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 188 "gitg-commit-action-create-patch.c"
				goto __catch57_g_regex_error;
			}
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1382 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			return NULL;
#line 197 "gitg-commit-action-create-patch.c"
		}
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp6_ = regex;
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp7_ = replacement;
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp8_ = g_regex_replace_literal (_tmp6_, self, (gssize) -1, 0, _tmp7_, 0, &_inner_error_);
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp5_ = _tmp8_;
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 213 "gitg-commit-action-create-patch.c"
				goto __catch57_g_regex_error;
			}
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
			return NULL;
#line 224 "gitg-commit-action-create-patch.c"
		}
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp9_ = _tmp5_;
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_tmp5_ = NULL;
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		result = _tmp9_;
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_g_free0 (_tmp5_);
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_g_regex_unref0 (regex);
#line 1383 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		return result;
#line 238 "gitg-commit-action-create-patch.c"
	}
	goto __finally57;
	__catch57_g_regex_error:
	{
		GError* e = NULL;
#line 1381 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		e = _inner_error_;
#line 1381 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_inner_error_ = NULL;
#line 1385 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		g_assert_not_reached ();
#line 1381 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		_g_error_free0 (e);
#line 252 "gitg-commit-action-create-patch.c"
	}
	__finally57:
#line 1381 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1381 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1381 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		g_clear_error (&_inner_error_);
#line 1381 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		return NULL;
#line 263 "gitg-commit-action-create-patch.c"
	}
}


static gchar* gitg_commit_action_create_patch_patch_filename (GitgCommitActionCreatePatch* self, gint i) {
	gchar* result = NULL;
	gchar* subject = NULL;
	GitgCommit* _tmp0_ = NULL;
	GitgCommit* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	GError * _inner_error_ = NULL;
#line 71 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 73 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = gitg_ext_commit_action_get_commit ((GitgExtCommitAction*) self);
#line 73 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = _tmp0_;
#line 73 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp2_ = ggit_commit_get_subject ((GgitCommit*) _tmp1_);
#line 73 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp3_ = g_strdup (_tmp2_);
#line 73 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	subject = _tmp3_;
#line 290 "gitg-commit-action-create-patch.c"
	{
		gchar* _tmp4_ = NULL;
		GRegex* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		gint _tmp8_ = 0;
		gint _tmp9_ = 0;
		gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
		gint _tmp14_ = 0;
		const gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp5_ = gitg_commit_action_create_patch_s_subject_regex;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp6_ = subject;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp7_ = subject;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp8_ = strlen (_tmp7_);
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp9_ = _tmp8_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp10_ = g_regex_replace (_tmp5_, _tmp6_, (gssize) _tmp9_, 0, "", 0, &_inner_error_);
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp4_ = _tmp10_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 321 "gitg-commit-action-create-patch.c"
			goto __catch56_g_error;
		}
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp11_ = _tmp4_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp4_ = NULL;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_free0 (subject);
#line 81 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		subject = _tmp11_;
#line 82 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp12_ = subject;
#line 82 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp13_ = string_replace (_tmp12_, " ", "-");
#line 82 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_free0 (subject);
#line 82 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		subject = _tmp13_;
#line 84 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp14_ = i;
#line 84 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp15_ = subject;
#line 84 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp16_ = g_strdup_printf ("%04d-%s", _tmp14_, _tmp15_);
#line 84 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_free0 (subject);
#line 84 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		subject = _tmp16_;
#line 79 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_free0 (_tmp4_);
#line 352 "gitg-commit-action-create-patch.c"
	}
	goto __finally56;
	__catch56_g_error:
	{
		gchar* _tmp17_ = NULL;
#line 79 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_clear_error (&_inner_error_);
#line 79 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_inner_error_ = NULL;
#line 88 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp17_ = g_strdup ("");
#line 88 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		result = _tmp17_;
#line 88 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_free0 (subject);
#line 88 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		return result;
#line 370 "gitg-commit-action-create-patch.c"
	}
	__finally56:
#line 79 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 79 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_free0 (subject);
#line 79 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 79 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_clear_error (&_inner_error_);
#line 79 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		return NULL;
#line 383 "gitg-commit-action-create-patch.c"
	}
#line 91 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp18_ = subject;
#line 91 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp19_ = g_strconcat (_tmp18_, ".patch", NULL);
#line 91 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	result = _tmp19_;
#line 91 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_free0 (subject);
#line 91 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return result;
#line 395 "gitg-commit-action-create-patch.c"
}


static GgitDiff* gitg_commit_action_create_patch_create_diff_from_commit (GitgCommitActionCreatePatch* self, GError** error) {
	GgitDiff* result = NULL;
	GSettings* settings = NULL;
	GSettings* _tmp0_ = NULL;
	GgitDiffOptions* opts = NULL;
	GgitDiffOptions* _tmp1_ = NULL;
	GSettings* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	gint nc = 0;
	GSettings* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	GgitDiffOptions* _tmp10_ = NULL;
	GgitDiffOptions* _tmp11_ = NULL;
	GgitDiffOptions* _tmp12_ = NULL;
	GgitDiffOptions* _tmp13_ = NULL;
	GgitDiffOption _tmp14_ = 0;
	GgitDiffOption _tmp15_ = 0;
	GitgCommit* _tmp16_ = NULL;
	GitgCommit* _tmp17_ = NULL;
	GgitDiffOptions* _tmp18_ = NULL;
	GgitDiff* _tmp19_ = NULL;
#line 94 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 96 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = g_settings_new ("org.gnome.gitg.preferences.diff");
#line 96 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	settings = _tmp0_;
#line 98 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = ggit_diff_options_new ();
#line 98 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	opts = _tmp1_;
#line 100 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp2_ = settings;
#line 100 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp3_ = g_settings_get_boolean (_tmp2_, "ignore-whitespace");
#line 100 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	if (_tmp3_) {
#line 436 "gitg-commit-action-create-patch.c"
		GgitDiffOptions* _tmp4_ = NULL;
		GgitDiffOptions* _tmp5_ = NULL;
		GgitDiffOption _tmp6_ = 0;
		GgitDiffOption _tmp7_ = 0;
#line 102 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp4_ = opts;
#line 102 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp5_ = opts;
#line 102 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp6_ = ggit_diff_options_get_flags (_tmp5_);
#line 102 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp7_ = _tmp6_;
#line 102 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		ggit_diff_options_set_flags (_tmp5_, _tmp7_ | GGIT_DIFF_IGNORE_WHITESPACE);
#line 451 "gitg-commit-action-create-patch.c"
	}
#line 105 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp8_ = settings;
#line 105 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp9_ = g_settings_get_int (_tmp8_, "context-lines");
#line 105 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	nc = _tmp9_;
#line 107 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp10_ = opts;
#line 107 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	ggit_diff_options_set_n_context_lines (_tmp10_, nc);
#line 108 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp11_ = opts;
#line 108 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	ggit_diff_options_set_n_interhunk_lines (_tmp11_, nc);
#line 110 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp12_ = opts;
#line 110 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp13_ = opts;
#line 110 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp14_ = ggit_diff_options_get_flags (_tmp13_);
#line 110 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp15_ = _tmp14_;
#line 110 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	ggit_diff_options_set_flags (_tmp13_, _tmp15_ | GGIT_DIFF_SHOW_BINARY);
#line 112 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp16_ = gitg_ext_commit_action_get_commit ((GitgExtCommitAction*) self);
#line 112 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp17_ = _tmp16_;
#line 112 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp18_ = opts;
#line 112 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp19_ = gitg_commit_get_diff (_tmp17_, _tmp18_, 0);
#line 112 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	result = _tmp19_;
#line 112 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (opts);
#line 112 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (settings);
#line 112 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return result;
#line 493 "gitg-commit-action-create-patch.c"
}


static void _vala_GgitOId_free (GgitOId* self) {
#line 128 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_boxed_free (ggit_oid_get_type (), self);
#line 500 "gitg-commit-action-create-patch.c"
}


static guint8* string_get_data (const gchar* self, int* result_length1) {
	guint8* result;
	guint8* res = NULL;
	gint res_length1 = 0;
	gint _res_size_ = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	guint8* _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	guint8* _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
#line 1398 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1399 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	res = (guint8*) self;
#line 1399 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	res_length1 = -1;
#line 1399 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	_res_size_ = res_length1;
#line 1400 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	_tmp0_ = strlen (self);
#line 1400 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	_tmp1_ = _tmp0_;
#line 1400 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	res_length1 = (gint) _tmp1_;
#line 1400 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	_tmp2_ = res_length1;
#line 1401 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	_tmp3_ = res;
#line 1401 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	_tmp3__length1 = res_length1;
#line 1401 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	_tmp4_ = _tmp3_;
#line 1401 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	_tmp4__length1 = _tmp3__length1;
#line 1401 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	if (result_length1) {
#line 1401 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
		*result_length1 = _tmp4__length1;
#line 544 "gitg-commit-action-create-patch.c"
	}
#line 1401 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	result = _tmp4_;
#line 1401 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	return result;
#line 550 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_create_patch (GitgCommitActionCreatePatch* self, GFile* file, GError** error) {
	GgitDiff* _tmp0_ = NULL;
	GgitDiffFormatEmailOptions* opts = NULL;
	GgitDiffFormatEmailOptions* _tmp3_ = NULL;
	GgitDiffFormatEmailOptions* _tmp4_ = NULL;
	GitgCommit* _tmp5_ = NULL;
	GitgCommit* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	GgitDiffFormatEmailOptions* _tmp8_ = NULL;
	GgitDiffFormatEmailOptions* _tmp9_ = NULL;
	GgitDiffFormatEmailOptions* _tmp10_ = NULL;
	GitgCommit* _tmp11_ = NULL;
	GitgCommit* _tmp12_ = NULL;
	GgitOId* _tmp13_ = NULL;
	GgitOId* _tmp14_ = NULL;
	GgitDiffFormatEmailOptions* _tmp15_ = NULL;
	GitgCommit* _tmp16_ = NULL;
	GitgCommit* _tmp17_ = NULL;
	GgitSignature* _tmp18_ = NULL;
	GgitSignature* _tmp19_ = NULL;
	gchar* content = NULL;
	GgitDiff* _tmp20_ = NULL;
	GgitDiffFormatEmailOptions* _tmp21_ = NULL;
	gchar* _tmp22_ = NULL;
	GFile* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	guint8* _tmp25_ = NULL;
	gint _tmp25__length1 = 0;
	guint8* _tmp26_ = NULL;
	gint _tmp26__length1 = 0;
	const gchar* _tmp27_ = NULL;
	gint _tmp28_ = 0;
	gint _tmp29_ = 0;
	GError * _inner_error_ = NULL;
#line 115 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_if_fail (self != NULL);
#line 115 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_if_fail (file != NULL);
#line 118 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = self->priv->_diff;
#line 118 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	if (_tmp0_ == NULL) {
#line 596 "gitg-commit-action-create-patch.c"
		GgitDiff* _tmp1_ = NULL;
		GgitDiff* _tmp2_ = NULL;
#line 120 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp2_ = gitg_commit_action_create_patch_create_diff_from_commit (self, &_inner_error_);
#line 120 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp1_ = _tmp2_;
#line 120 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 120 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			g_propagate_error (error, _inner_error_);
#line 120 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			return;
#line 609 "gitg-commit-action-create-patch.c"
		}
#line 120 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		gitg_commit_action_create_patch_set_diff (self, _tmp1_);
#line 118 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_object_unref0 (_tmp1_);
#line 615 "gitg-commit-action-create-patch.c"
	}
#line 123 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp3_ = ggit_diff_format_email_options_new ();
#line 123 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	opts = _tmp3_;
#line 125 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp4_ = opts;
#line 125 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp5_ = gitg_ext_commit_action_get_commit ((GitgExtCommitAction*) self);
#line 125 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp6_ = _tmp5_;
#line 125 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp7_ = ggit_commit_get_message ((GgitCommit*) _tmp6_);
#line 125 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	ggit_diff_format_email_options_set_summary (_tmp4_, _tmp7_);
#line 126 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp8_ = opts;
#line 126 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	ggit_diff_format_email_options_set_patch_number (_tmp8_, (guint64) 1);
#line 127 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp9_ = opts;
#line 127 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	ggit_diff_format_email_options_set_total_patches (_tmp9_, (guint64) 1);
#line 128 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp10_ = opts;
#line 128 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp11_ = gitg_ext_commit_action_get_commit ((GitgExtCommitAction*) self);
#line 128 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp12_ = _tmp11_;
#line 128 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp13_ = ggit_object_get_id ((GgitObject*) _tmp12_);
#line 128 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp14_ = _tmp13_;
#line 128 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	ggit_diff_format_email_options_set_id (_tmp10_, _tmp14_);
#line 128 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	__vala_GgitOId_free0 (_tmp14_);
#line 129 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp15_ = opts;
#line 129 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp16_ = gitg_ext_commit_action_get_commit ((GitgExtCommitAction*) self);
#line 129 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp17_ = _tmp16_;
#line 129 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp18_ = ggit_commit_get_author ((GgitCommit*) _tmp17_);
#line 129 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp19_ = _tmp18_;
#line 129 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	ggit_diff_format_email_options_set_author (_tmp15_, _tmp19_);
#line 129 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (_tmp19_);
#line 131 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp20_ = self->priv->_diff;
#line 131 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp21_ = opts;
#line 131 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp22_ = ggit_diff_format_email (_tmp20_, _tmp21_, &_inner_error_);
#line 131 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	content = _tmp22_;
#line 131 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 131 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_propagate_error (error, _inner_error_);
#line 131 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_object_unref0 (opts);
#line 131 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		return;
#line 683 "gitg-commit-action-create-patch.c"
	}
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp23_ = file;
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp24_ = content;
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp25_ = string_get_data (_tmp24_, &_tmp25__length1);
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp26_ = _tmp25_;
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp26__length1 = _tmp25__length1;
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp27_ = content;
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp28_ = strlen (_tmp27_);
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp29_ = _tmp28_;
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_file_replace_contents (_tmp23_, _tmp26_ + 0, (gsize) (_tmp29_ - 0), NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL, &_inner_error_);
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_propagate_error (error, _inner_error_);
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_free0 (content);
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_object_unref0 (opts);
#line 133 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		return;
#line 713 "gitg-commit-action-create-patch.c"
	}
#line 115 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_free0 (content);
#line 115 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (opts);
#line 719 "gitg-commit-action-create-patch.c"
}


static Block37Data* block37_data_ref (Block37Data* _data37_) {
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_atomic_int_inc (&_data37_->_ref_count_);
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return _data37_;
#line 728 "gitg-commit-action-create-patch.c"
}


static void block37_data_unref (void * _userdata_) {
	Block37Data* _data37_;
	_data37_ = (Block37Data*) _userdata_;
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	if (g_atomic_int_dec_and_test (&_data37_->_ref_count_)) {
#line 737 "gitg-commit-action-create-patch.c"
		GitgCommitActionCreatePatch* self;
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		self = _data37_->self;
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_object_unref0 (_data37_->chooser);
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_object_unref0 (self);
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_slice_free (Block37Data, _data37_);
#line 747 "gitg-commit-action-create-patch.c"
	}
}


static void __lambda154_ (Block37Data* _data37_, GtkDialog* dialog, gint id) {
	GitgCommitActionCreatePatch* self;
	gint _tmp0_ = 0;
	GError * _inner_error_ = NULL;
#line 163 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = _data37_->self;
#line 163 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_if_fail (dialog != NULL);
#line 164 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = id;
#line 164 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	if (_tmp0_ == ((gint) GTK_RESPONSE_OK)) {
#line 764 "gitg-commit-action-create-patch.c"
		{
			GFile* _tmp1_ = NULL;
			GFile* _tmp2_ = NULL;
#line 168 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_tmp1_ = gtk_file_chooser_get_file ((GtkFileChooser*) _data37_->chooser);
#line 168 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_tmp2_ = _tmp1_;
#line 168 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			gitg_commit_action_create_patch_create_patch (self, _tmp2_, &_inner_error_);
#line 168 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_g_object_unref0 (_tmp2_);
#line 168 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 778 "gitg-commit-action-create-patch.c"
				goto __catch59_g_error;
			}
		}
		goto __finally59;
		__catch59_g_error:
		{
			GError* e = NULL;
			GitgExtApplication* _tmp3_ = NULL;
			GitgExtApplication* _tmp4_ = NULL;
			GitgExtApplication* _tmp5_ = NULL;
			const gchar* _tmp6_ = NULL;
			GError* _tmp7_ = NULL;
			const gchar* _tmp8_ = NULL;
#line 166 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			e = _inner_error_;
#line 166 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_inner_error_ = NULL;
#line 172 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_tmp3_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
#line 172 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_tmp4_ = _tmp3_;
#line 172 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_tmp5_ = _tmp4_;
#line 172 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_tmp6_ = _ ("Failed to create patch");
#line 172 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_tmp7_ = e;
#line 172 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_tmp8_ = _tmp7_->message;
#line 172 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			gitg_ext_application_show_infobar (_tmp5_, _tmp6_, _tmp8_, GTK_MESSAGE_ERROR);
#line 172 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_g_object_unref0 (_tmp5_);
#line 166 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			_g_error_free0 (e);
#line 814 "gitg-commit-action-create-patch.c"
		}
		__finally59:
#line 166 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 166 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 166 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			g_clear_error (&_inner_error_);
#line 166 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
			return;
#line 825 "gitg-commit-action-create-patch.c"
		}
	}
#line 178 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gtk_widget_destroy ((GtkWidget*) _data37_->chooser);
#line 179 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_signal_emit_by_name ((GitgExtCommitAction*) self, "finished");
#line 832 "gitg-commit-action-create-patch.c"
}


static void ___lambda154__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
#line 163 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	__lambda154_ (self, _sender, response_id);
#line 839 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_real_activate (GitgExtUIElement* base) {
	GitgCommitActionCreatePatch * self;
	Block37Data* _data37_;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	GtkFileChooserDialog* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	GitgExtApplication* _tmp14_ = NULL;
	GitgExtApplication* _tmp15_ = NULL;
	GtkWindow* _tmp16_ = NULL;
	GError * _inner_error_ = NULL;
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_data37_ = g_slice_new0 (Block37Data);
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_data37_->_ref_count_ = 1;
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_data37_->self = g_object_ref (self);
#line 143 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = _ ("Save Patch File");
#line 143 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = _ ("_Cancel");
#line 143 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp2_ = _ ("_Save Patch");
#line 143 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp3_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_tmp0_, NULL, GTK_FILE_CHOOSER_ACTION_SAVE, _tmp1_, GTK_RESPONSE_CANCEL, _tmp2_, GTK_RESPONSE_OK, NULL);
#line 143 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_ref_sink (_tmp3_);
#line 143 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_data37_->chooser = _tmp3_;
#line 150 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gtk_dialog_set_default_response ((GtkDialog*) _data37_->chooser, (gint) GTK_RESPONSE_OK);
#line 152 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser*) _data37_->chooser, TRUE);
#line 153 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp4_ = gitg_commit_action_create_patch_patch_filename (self, 1);
#line 153 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp5_ = _tmp4_;
#line 153 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gtk_file_chooser_set_current_name ((GtkFileChooser*) _data37_->chooser, _tmp5_);
#line 153 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_free0 (_tmp5_);
#line 888 "gitg-commit-action-create-patch.c"
	{
		GitgExtApplication* _tmp6_ = NULL;
		GitgExtApplication* _tmp7_ = NULL;
		GitgExtApplication* _tmp8_ = NULL;
		GitgRepository* _tmp9_ = NULL;
		GitgRepository* _tmp10_ = NULL;
		GitgRepository* _tmp11_ = NULL;
		GFile* _tmp12_ = NULL;
		GFile* _tmp13_ = NULL;
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp6_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp7_ = _tmp6_;
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp8_ = _tmp7_;
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp9_ = gitg_ext_application_get_repository (_tmp8_);
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp10_ = _tmp9_;
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp11_ = _tmp10_;
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp12_ = ggit_repository_get_workdir ((GgitRepository*) _tmp11_);
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp13_ = _tmp12_;
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		gtk_file_chooser_set_current_folder_file ((GtkFileChooser*) _data37_->chooser, _tmp13_, &_inner_error_);
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_object_unref0 (_tmp13_);
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_object_unref0 (_tmp11_);
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_object_unref0 (_tmp8_);
#line 157 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 924 "gitg-commit-action-create-patch.c"
			goto __catch58_g_error;
		}
	}
	goto __finally58;
	__catch58_g_error:
	{
#line 155 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_clear_error (&_inner_error_);
#line 155 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_inner_error_ = NULL;
#line 935 "gitg-commit-action-create-patch.c"
	}
	__finally58:
#line 155 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 155 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		block37_data_unref (_data37_);
#line 155 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_data37_ = NULL;
#line 155 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 155 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_clear_error (&_inner_error_);
#line 155 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		return;
#line 950 "gitg-commit-action-create-patch.c"
	}
#line 160 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp14_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
#line 160 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp15_ = _tmp14_;
#line 160 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp16_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_window_get_type (), GtkWindow);
#line 160 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gtk_window_set_transient_for ((GtkWindow*) _data37_->chooser, _tmp16_);
#line 160 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (_tmp16_);
#line 162 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gtk_widget_show ((GtkWidget*) _data37_->chooser);
#line 163 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_signal_connect_data ((GtkDialog*) _data37_->chooser, "response", (GCallback) ___lambda154__gtk_dialog_response, block37_data_ref (_data37_), (GClosureNotify) block37_data_unref, 0);
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	block37_data_unref (_data37_);
#line 141 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_data37_ = NULL;
#line 970 "gitg-commit-action-create-patch.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return self ? g_object_ref (self) : NULL;
#line 977 "gitg-commit-action-create-patch.c"
}


static GitgExtApplication* gitg_commit_action_create_patch_real_get_application (GitgExtUIElement* base) {
	GitgExtApplication* result;
	GitgCommitActionCreatePatch* self;
	GitgExtApplication* _tmp0_ = NULL;
	GitgExtApplication* _tmp1_ = NULL;
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = self->priv->_application;
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	result = _tmp1_;
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return result;
#line 996 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_real_set_application (GitgExtUIElement* base, GitgExtApplication* value) {
	GitgCommitActionCreatePatch* self;
	GitgExtApplication* _tmp0_ = NULL;
	GitgExtApplication* _tmp1_ = NULL;
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = value;
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (self->priv->_application);
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self->priv->_application = _tmp1_;
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_notify ((GObject *) self, "application");
#line 1016 "gitg-commit-action-create-patch.c"
}


static GitgExtRefActionInterface* gitg_commit_action_create_patch_real_get_action_interface (GitgExtCommitAction* base) {
	GitgExtRefActionInterface* result;
	GitgCommitActionCreatePatch* self;
	GitgExtRefActionInterface* _tmp0_ = NULL;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = self->priv->_action_interface;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	result = _tmp0_;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return result;
#line 1032 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_real_set_action_interface (GitgExtCommitAction* base, GitgExtRefActionInterface* value) {
	GitgCommitActionCreatePatch* self;
	GitgExtRefActionInterface* _tmp0_ = NULL;
	GitgExtRefActionInterface* _tmp1_ = NULL;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = value;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (self->priv->_action_interface);
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self->priv->_action_interface = _tmp1_;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_notify ((GObject *) self, "action-interface");
#line 1052 "gitg-commit-action-create-patch.c"
}


static GitgCommit* gitg_commit_action_create_patch_real_get_commit (GitgExtCommitAction* base) {
	GitgCommit* result;
	GitgCommitActionCreatePatch* self;
	GitgCommit* _tmp0_ = NULL;
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = self->priv->_commit;
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	result = _tmp0_;
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return result;
#line 1068 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_real_set_commit (GitgExtCommitAction* base, GitgCommit* value) {
	GitgCommitActionCreatePatch* self;
	GitgCommit* _tmp0_ = NULL;
	GitgCommit* _tmp1_ = NULL;
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = value;
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (self->priv->_commit);
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self->priv->_commit = _tmp1_;
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_notify ((GObject *) self, "commit");
#line 1088 "gitg-commit-action-create-patch.c"
}


GgitDiff* gitg_commit_action_create_patch_get_diff (GitgCommitActionCreatePatch* self) {
	GgitDiff* result;
	GgitDiff* _tmp0_ = NULL;
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = self->priv->_diff;
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	result = _tmp0_;
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return result;
#line 1103 "gitg-commit-action-create-patch.c"
}


void gitg_commit_action_create_patch_set_diff (GitgCommitActionCreatePatch* self, GgitDiff* value) {
	GgitDiff* _tmp0_ = NULL;
	GgitDiff* _tmp1_ = NULL;
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_return_if_fail (self != NULL);
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = value;
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (self->priv->_diff);
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self->priv->_diff = _tmp1_;
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_notify ((GObject *) self, "diff");
#line 1122 "gitg-commit-action-create-patch.c"
}


static gchar* gitg_commit_action_create_patch_real_get_id (GitgExtUIElement* base) {
	gchar* result;
	GitgCommitActionCreatePatch* self;
	gchar* _tmp0_ = NULL;
#line 58 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 58 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = g_strdup ("/org/gnome/gitg/commit-actions/create-patch");
#line 58 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	result = _tmp0_;
#line 58 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return result;
#line 1138 "gitg-commit-action-create-patch.c"
}


static gchar* gitg_commit_action_create_patch_real_get_display_name (GitgExtUIElement* base) {
	gchar* result;
	GitgCommitActionCreatePatch* self;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
#line 63 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 63 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = _ ("Create patch");
#line 63 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 63 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	result = _tmp1_;
#line 63 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return result;
#line 1157 "gitg-commit-action-create-patch.c"
}


static gchar* gitg_commit_action_create_patch_real_get_description (GitgExtUIElement* base) {
	gchar* result;
	GitgCommitActionCreatePatch* self;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
#line 68 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = (GitgCommitActionCreatePatch*) base;
#line 68 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp0_ = _ ("Create a patch from the selected commit");
#line 68 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 68 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	result = _tmp1_;
#line 68 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	return result;
#line 1176 "gitg-commit-action-create-patch.c"
}


static const gchar* string_to_string (const gchar* self) {
	const gchar* result = NULL;
#line 1412 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1413 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	result = self;
#line 1413 "/usr/share/vala-0.32/vapi/glib-2.0.vapi"
	return result;
#line 1188 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_class_init (GitgCommitActionCreatePatchClass * klass) {
	GError * _inner_error_ = NULL;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gitg_commit_action_create_patch_parent_class = g_type_class_peek_parent (klass);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_type_class_add_private (klass, sizeof (GitgCommitActionCreatePatchPrivate));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_commit_action_create_patch_get_property;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_commit_action_create_patch_set_property;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	G_OBJECT_CLASS (klass)->finalize = gitg_commit_action_create_patch_finalize;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_PATCH_APPLICATION, g_param_spec_object ("application", "application", "application", GITG_EXT_TYPE_APPLICATION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_PATCH_ACTION_INTERFACE, g_param_spec_object ("action-interface", "action-interface", "action-interface", GITG_EXT_TYPE_REF_ACTION_INTERFACE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_PATCH_COMMIT, g_param_spec_object ("commit", "commit", "commit", GITG_TYPE_COMMIT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_PATCH_DIFF, g_param_spec_object ("diff", "diff", "diff", ggit_diff_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_PATCH_ID, g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_PATCH_DISPLAY_NAME, g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_PATCH_DESCRIPTION, g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 1218 "gitg-commit-action-create-patch.c"
	{
		GRegex* _tmp0_ = NULL;
		GRegex* _tmp1_ = NULL;
		GRegex* _tmp2_ = NULL;
#line 39 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp1_ = g_regex_new ("[^\\d\\w \\_\\-]", 0, 0, &_inner_error_);
#line 39 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp0_ = _tmp1_;
#line 39 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1229 "gitg-commit-action-create-patch.c"
			goto __catch60_g_error;
		}
#line 39 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp2_ = _tmp0_;
#line 39 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp0_ = NULL;
#line 39 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_regex_unref0 (gitg_commit_action_create_patch_s_subject_regex);
#line 39 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		gitg_commit_action_create_patch_s_subject_regex = _tmp2_;
#line 37 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_regex_unref0 (_tmp0_);
#line 1242 "gitg-commit-action-create-patch.c"
	}
	goto __finally60;
	__catch60_g_error:
	{
		GError* e = NULL;
		FILE* _tmp3_ = NULL;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
#line 37 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		e = _inner_error_;
#line 37 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_inner_error_ = NULL;
#line 43 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp3_ = stderr;
#line 43 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp4_ = e;
#line 43 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp5_ = _tmp4_->message;
#line 43 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp6_ = string_to_string (_tmp5_);
#line 43 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp7_ = g_strconcat ("Failed to compile subject regex: ", _tmp6_, "\n", NULL);
#line 43 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_tmp8_ = _tmp7_;
#line 43 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		fprintf (_tmp3_, "%s", _tmp8_);
#line 43 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_free0 (_tmp8_);
#line 37 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		_g_error_free0 (e);
#line 1276 "gitg-commit-action-create-patch.c"
	}
	__finally60:
#line 37 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 37 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 37 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_clear_error (&_inner_error_);
#line 1285 "gitg-commit-action-create-patch.c"
	}
}


static void gitg_commit_action_create_patch_gitg_ext_ui_element_interface_init (GitgExtUIElementIface * iface) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gitg_commit_action_create_patch_gitg_ext_ui_element_parent_iface = g_type_interface_peek_parent (iface);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->activate = (void (*)(GitgExtUIElement*)) gitg_commit_action_create_patch_real_activate;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->get_application = gitg_commit_action_create_patch_real_get_application;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->set_application = gitg_commit_action_create_patch_real_set_application;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->get_id = gitg_commit_action_create_patch_real_get_id;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->get_display_name = gitg_commit_action_create_patch_real_get_display_name;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->get_description = gitg_commit_action_create_patch_real_get_description;
#line 1305 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_gitg_ext_action_interface_init (GitgExtActionIface * iface) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gitg_commit_action_create_patch_gitg_ext_action_parent_iface = g_type_interface_peek_parent (iface);
#line 1312 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_gitg_ext_commit_action_interface_init (GitgExtCommitActionIface * iface) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	gitg_commit_action_create_patch_gitg_ext_commit_action_parent_iface = g_type_interface_peek_parent (iface);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->get_action_interface = gitg_commit_action_create_patch_real_get_action_interface;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->set_action_interface = gitg_commit_action_create_patch_real_set_action_interface;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->get_commit = gitg_commit_action_create_patch_real_get_commit;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	iface->set_commit = gitg_commit_action_create_patch_real_set_commit;
#line 1327 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_instance_init (GitgCommitActionCreatePatch * self) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self->priv = GITG_COMMIT_ACTION_CREATE_PATCH_GET_PRIVATE (self);
#line 1334 "gitg-commit-action-create-patch.c"
}


static void gitg_commit_action_create_patch_finalize (GObject* obj) {
	GitgCommitActionCreatePatch * self;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatch);
#line 28 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (self->priv->_application);
#line 29 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (self->priv->_action_interface);
#line 30 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (self->priv->_commit);
#line 31 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	_g_object_unref0 (self->priv->_diff);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	G_OBJECT_CLASS (gitg_commit_action_create_patch_parent_class)->finalize (obj);
#line 1352 "gitg-commit-action-create-patch.c"
}


GType gitg_commit_action_create_patch_get_type (void) {
	static volatile gsize gitg_commit_action_create_patch_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_commit_action_create_patch_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GitgCommitActionCreatePatchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_commit_action_create_patch_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgCommitActionCreatePatch), 0, (GInstanceInitFunc) gitg_commit_action_create_patch_instance_init, NULL };
		static const GInterfaceInfo gitg_ext_ui_element_info = { (GInterfaceInitFunc) gitg_commit_action_create_patch_gitg_ext_ui_element_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo gitg_ext_action_info = { (GInterfaceInitFunc) gitg_commit_action_create_patch_gitg_ext_action_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo gitg_ext_commit_action_info = { (GInterfaceInitFunc) gitg_commit_action_create_patch_gitg_ext_commit_action_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gitg_commit_action_create_patch_type_id;
		gitg_commit_action_create_patch_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgCommitActionCreatePatch", &g_define_type_info, 0);
		g_type_add_interface_static (gitg_commit_action_create_patch_type_id, GITG_EXT_TYPE_UI_ELEMENT, &gitg_ext_ui_element_info);
		g_type_add_interface_static (gitg_commit_action_create_patch_type_id, GITG_EXT_TYPE_ACTION, &gitg_ext_action_info);
		g_type_add_interface_static (gitg_commit_action_create_patch_type_id, GITG_EXT_TYPE_COMMIT_ACTION, &gitg_ext_commit_action_info);
		g_once_init_leave (&gitg_commit_action_create_patch_type_id__volatile, gitg_commit_action_create_patch_type_id);
	}
	return gitg_commit_action_create_patch_type_id__volatile;
}


static void _vala_gitg_commit_action_create_patch_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GitgCommitActionCreatePatch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatch);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	switch (property_id) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_APPLICATION:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_value_take_object (value, gitg_ext_ui_element_get_application ((GitgExtUIElement*) self));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_ACTION_INTERFACE:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_value_set_object (value, gitg_ext_commit_action_get_action_interface ((GitgExtCommitAction*) self));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_COMMIT:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_value_set_object (value, gitg_ext_commit_action_get_commit ((GitgExtCommitAction*) self));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_DIFF:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_value_set_object (value, gitg_commit_action_create_patch_get_diff (self));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_ID:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_value_take_string (value, gitg_ext_ui_element_get_id ((GitgExtUIElement*) self));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_DISPLAY_NAME:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_value_take_string (value, gitg_ext_ui_element_get_display_name ((GitgExtUIElement*) self));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_DESCRIPTION:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		g_value_take_string (value, gitg_ext_ui_element_get_description ((GitgExtUIElement*) self));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 1421 "gitg-commit-action-create-patch.c"
		default:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 1427 "gitg-commit-action-create-patch.c"
	}
}


static void _vala_gitg_commit_action_create_patch_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GitgCommitActionCreatePatch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatch);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
	switch (property_id) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_APPLICATION:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		gitg_ext_ui_element_set_application ((GitgExtUIElement*) self, g_value_get_object (value));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_ACTION_INTERFACE:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		gitg_ext_commit_action_set_action_interface ((GitgExtCommitAction*) self, g_value_get_object (value));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_COMMIT:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		gitg_ext_commit_action_set_commit ((GitgExtCommitAction*) self, g_value_get_object (value));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		case GITG_COMMIT_ACTION_CREATE_PATCH_DIFF:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		gitg_commit_action_create_patch_set_diff (self, g_value_get_object (value));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 1461 "gitg-commit-action-create-patch.c"
		default:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-commit-action-create-patch.vala"
		break;
#line 1467 "gitg-commit-action-create-patch.c"
	}
}



