/* gitg-commit.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-commit.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2012 - 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-object.h>
#include "libgitg-ext.h"
#include <gtk/gtk.h>
#include <glib.h>
#include "libgitg.h"
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include <gdk/gdk.h>
#include <libgit2-glib/ggit.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <stdio.h>
#include <gee.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

#define GITG_COMMIT_ACTIVITY_version VERSION
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define GITG_COMMIT_TYPE_ACTIVITY (gitg_commit_activity_get_type ())
#define GITG_COMMIT_ACTIVITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivity))
#define GITG_COMMIT_ACTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivityClass))
#define GITG_COMMIT_IS_ACTIVITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_ACTIVITY))
#define GITG_COMMIT_IS_ACTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_ACTIVITY))
#define GITG_COMMIT_ACTIVITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivityClass))

typedef struct _GitgCommitActivity GitgCommitActivity;
typedef struct _GitgCommitActivityClass GitgCommitActivityClass;
typedef struct _GitgCommitActivityPrivate GitgCommitActivityPrivate;

#define GITG_COMMIT_TYPE_PANED (gitg_commit_paned_get_type ())
#define GITG_COMMIT_PANED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_PANED, GitgCommitPaned))
#define GITG_COMMIT_PANED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_PANED, GitgCommitPanedClass))
#define GITG_COMMIT_IS_PANED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_PANED))
#define GITG_COMMIT_IS_PANED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_PANED))
#define GITG_COMMIT_PANED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_PANED, GitgCommitPanedClass))

typedef struct _GitgCommitPaned GitgCommitPaned;
typedef struct _GitgCommitPanedClass GitgCommitPanedClass;
typedef void (*GitgCommitActivityUpdateDiffCallback) (gpointer user_data);
typedef void (*GitgCommitActivityStageUnstageSubmoduleCommitCallback) (GitgCommit* commit, gpointer user_data);
enum  {
	GITG_COMMIT_ACTIVITY_0_PROPERTY,
	GITG_COMMIT_ACTIVITY_APPLICATION_PROPERTY,
	GITG_COMMIT_ACTIVITY_ID_PROPERTY,
	GITG_COMMIT_ACTIVITY_REPOSITORY_PROPERTY,
	GITG_COMMIT_ACTIVITY_ENABLED_PROPERTY,
	GITG_COMMIT_ACTIVITY_DISPLAY_NAME_PROPERTY,
	GITG_COMMIT_ACTIVITY_DESCRIPTION_PROPERTY,
	GITG_COMMIT_ACTIVITY_ICON_PROPERTY,
	GITG_COMMIT_ACTIVITY_WIDGET_PROPERTY,
	GITG_COMMIT_ACTIVITY_NUM_PROPERTIES
};
static GParamSpec* gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_NUM_PROPERTIES];
typedef enum  {
	GITG_COMMIT_ACTIVITY_UI_TYPE_DIFF,
	GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_HISTORY,
	GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_DIFF
} GitgCommitActivityUiType;

#define GITG_COMMIT_ACTIVITY_TYPE_UI_TYPE (gitg_commit_activity_ui_type_get_type ())
typedef enum  {
	GITG_COMMIT_ACTIVITY_INDEX_TYPE_STAGED,
	GITG_COMMIT_ACTIVITY_INDEX_TYPE_UNSTAGED
} GitgCommitActivityIndexType;

#define GITG_COMMIT_ACTIVITY_TYPE_INDEX_TYPE (gitg_commit_activity_index_type_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _gitg_when_mapped_unref0(var) ((var == NULL) ? NULL : (var = (gitg_when_mapped_unref (var), NULL)))
typedef struct _Block17Data Block17Data;
typedef struct _Block18Data Block18Data;
#define _g_free0(var) (var = (g_free (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 _GitgCommitActivityStageSubmoduleData GitgCommitActivityStageSubmoduleData;
typedef struct _GitgCommitActivityStageFileData GitgCommitActivityStageFileData;
typedef struct _GitgCommitActivityStageItemsData GitgCommitActivityStageItemsData;

#define GITG_COMMIT_TYPE_SUBMODULE_HISTORY_VIEW (gitg_commit_submodule_history_view_get_type ())
#define GITG_COMMIT_SUBMODULE_HISTORY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_SUBMODULE_HISTORY_VIEW, GitgCommitSubmoduleHistoryView))
#define GITG_COMMIT_SUBMODULE_HISTORY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_SUBMODULE_HISTORY_VIEW, GitgCommitSubmoduleHistoryViewClass))
#define GITG_COMMIT_IS_SUBMODULE_HISTORY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_SUBMODULE_HISTORY_VIEW))
#define GITG_COMMIT_IS_SUBMODULE_HISTORY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_SUBMODULE_HISTORY_VIEW))
#define GITG_COMMIT_SUBMODULE_HISTORY_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_SUBMODULE_HISTORY_VIEW, GitgCommitSubmoduleHistoryViewClass))

typedef struct _GitgCommitSubmoduleHistoryView GitgCommitSubmoduleHistoryView;
typedef struct _GitgCommitSubmoduleHistoryViewClass GitgCommitSubmoduleHistoryViewClass;

#define GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW (gitg_commit_submodule_diff_view_get_type ())
#define GITG_COMMIT_SUBMODULE_DIFF_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW, GitgCommitSubmoduleDiffView))
#define GITG_COMMIT_SUBMODULE_DIFF_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW, GitgCommitSubmoduleDiffViewClass))
#define GITG_COMMIT_IS_SUBMODULE_DIFF_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW))
#define GITG_COMMIT_IS_SUBMODULE_DIFF_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW))
#define GITG_COMMIT_SUBMODULE_DIFF_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW, GitgCommitSubmoduleDiffViewClass))

typedef struct _GitgCommitSubmoduleDiffView GitgCommitSubmoduleDiffView;
typedef struct _GitgCommitSubmoduleDiffViewClass GitgCommitSubmoduleDiffViewClass;

#define GITG_COMMIT_TYPE_SUBMODULE_INFO (gitg_commit_submodule_info_get_type ())
#define GITG_COMMIT_SUBMODULE_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_SUBMODULE_INFO, GitgCommitSubmoduleInfo))
#define GITG_COMMIT_SUBMODULE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_SUBMODULE_INFO, GitgCommitSubmoduleInfoClass))
#define GITG_COMMIT_IS_SUBMODULE_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_SUBMODULE_INFO))
#define GITG_COMMIT_IS_SUBMODULE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_SUBMODULE_INFO))
#define GITG_COMMIT_SUBMODULE_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_SUBMODULE_INFO, GitgCommitSubmoduleInfoClass))

typedef struct _GitgCommitSubmoduleInfo GitgCommitSubmoduleInfo;
typedef struct _GitgCommitSubmoduleInfoClass GitgCommitSubmoduleInfoClass;
#define _ggit_submodule_unref0(var) ((var == NULL) ? NULL : (var = (ggit_submodule_unref (var), NULL)))
typedef struct _Block19Data Block19Data;
typedef struct _Block20Data Block20Data;
typedef struct _GitgCommitActivityUnstageItemData GitgCommitActivityUnstageItemData;
typedef struct _GitgCommitActivityUnstageFileData GitgCommitActivityUnstageFileData;
typedef struct _GitgCommitActivityUnstageSubmoduleData GitgCommitActivityUnstageSubmoduleData;
typedef struct _GitgCommitActivityUnstageItemsData GitgCommitActivityUnstageItemsData;
typedef enum  {
	GITG_COMMIT_SIDEBAR_ITEM_TYPE_NONE,
	GITG_COMMIT_SIDEBAR_ITEM_TYPE_STAGED,
	GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNSTAGED,
	GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNTRACKED,
	GITG_COMMIT_SIDEBAR_ITEM_TYPE_SUBMODULE
} GitgCommitSidebarItemType;

#define GITG_COMMIT_SIDEBAR_ITEM_TYPE_TYPE (gitg_commit_sidebar_item_type_get_type ())

#define GITG_COMMIT_SIDEBAR_TYPE_ITEM (gitg_commit_sidebar_item_get_type ())
#define GITG_COMMIT_SIDEBAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_SIDEBAR_TYPE_ITEM, GitgCommitSidebarItem))
#define GITG_COMMIT_SIDEBAR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_SIDEBAR_TYPE_ITEM, GitgCommitSidebarItemClass))
#define GITG_COMMIT_SIDEBAR_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_SIDEBAR_TYPE_ITEM))
#define GITG_COMMIT_SIDEBAR_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_SIDEBAR_TYPE_ITEM))
#define GITG_COMMIT_SIDEBAR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_SIDEBAR_TYPE_ITEM, GitgCommitSidebarItemClass))

typedef struct _GitgCommitSidebarItem GitgCommitSidebarItem;
typedef struct _GitgCommitSidebarItemClass GitgCommitSidebarItemClass;
typedef void (*GitgCommitActivityStageUnstageCallback) (GitgCommitSidebarItem* item, gpointer user_data);
typedef struct _Block21Data Block21Data;
typedef struct _Block22Data Block22Data;
typedef struct _Block23Data Block23Data;

#define GITG_COMMIT_TYPE_SIDEBAR (gitg_commit_sidebar_get_type ())
#define GITG_COMMIT_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_SIDEBAR, GitgCommitSidebar))
#define GITG_COMMIT_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_SIDEBAR, GitgCommitSidebarClass))
#define GITG_COMMIT_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_SIDEBAR))
#define GITG_COMMIT_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_SIDEBAR))
#define GITG_COMMIT_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_SIDEBAR, GitgCommitSidebarClass))

typedef struct _GitgCommitSidebar GitgCommitSidebar;
typedef struct _GitgCommitSidebarClass GitgCommitSidebarClass;
typedef struct _Block24Data Block24Data;
#define __vala_GgitStatusOptions_free0(var) ((var == NULL) ? NULL : (var = (_vala_GgitStatusOptions_free (var), NULL)))

#define GITG_COMMIT_TYPE_DIALOG (gitg_commit_dialog_get_type ())
#define GITG_COMMIT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_DIALOG, GitgCommitDialog))
#define GITG_COMMIT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_DIALOG, GitgCommitDialogClass))
#define GITG_COMMIT_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_DIALOG))
#define GITG_COMMIT_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_DIALOG))
#define GITG_COMMIT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_DIALOG, GitgCommitDialogClass))

typedef struct _GitgCommitDialog GitgCommitDialog;
typedef struct _GitgCommitDialogClass GitgCommitDialogClass;
typedef struct _Block25Data Block25Data;
typedef struct _GitgCommitActivityPreCommitData GitgCommitActivityPreCommitData;
typedef struct _Block26Data Block26Data;
typedef struct _Block27Data Block27Data;
typedef struct _GitgCommitActivityIndexDiffData GitgCommitActivityIndexDiffData;
typedef struct _Block28Data Block28Data;
typedef struct _Block29Data Block29Data;
typedef struct _Block30Data Block30Data;
#define _gitg_patch_set_unref0(var) ((var == NULL) ? NULL : (var = (gitg_patch_set_unref (var), NULL)))
typedef struct _GitgCommitActivityStageUnstageSelectionData GitgCommitActivityStageUnstageSelectionData;
typedef struct _GitgCommitActivityDiscardSelectionData GitgCommitActivityDiscardSelectionData;
typedef struct _Block31Data Block31Data;
typedef struct _Block32Data Block32Data;
typedef struct _Block33Data Block33Data;
typedef struct _GitgCommitActivityRevertPathsData GitgCommitActivityRevertPathsData;
typedef struct _Block34Data Block34Data;
typedef struct _Block35Data Block35Data;
typedef struct _Block36Data Block36Data;
typedef struct _Block37Data Block37Data;
typedef struct _GitgCommitActivityDeleteFilesData GitgCommitActivityDeleteFilesData;
typedef struct _Block38Data Block38Data;
typedef struct _Block39Data Block39Data;
typedef struct _Block40Data Block40Data;
typedef struct _Block41Data Block41Data;

struct _GitgCommitActivity {
	GObject parent_instance;
	GitgCommitActivityPrivate * priv;
};

struct _GitgCommitActivityClass {
	GObjectClass parent_class;
};

struct _GitgCommitActivityPrivate {
	GitgCommitPaned* d_main;
	gboolean d_reloading;
	gboolean d_has_staged;
	gulong d_externally_changed_id;
	gboolean d_ignore_external_changes;
	GitgWhenMapped* d_reload_when_mapped;
	GitgExtApplication* _application;
	GitgCommitActivityUpdateDiffCallback d_update_diff_callback;
	gpointer d_update_diff_callback_target;
	GDestroyNotify d_update_diff_callback_target_destroy_notify;
	gboolean d_submodule_history_select_first;
	GitgStageStatusSubmodule* d_current_submodule;
	GitgRepository* d_current_submodule_repository;
	GitgCommitActivityStageUnstageSubmoduleCommitCallback d_stage_unstage_submodule_commit_callback;
	gpointer d_stage_unstage_submodule_commit_callback_target;
	GDestroyNotify d_stage_unstage_submodule_commit_callback_target_destroy_notify;
};

struct _Block17Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgRepository* repository;
	GitgDiffView* view;
	GitgStageStatusItem** items;
	gint items_length1;
	gboolean patchable;
};

struct _Block18Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgStage* stage;
	GitgDiffView* view;
	gboolean patchable;
};

struct _GitgCommitActivityStageSubmoduleData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GitgStageStatusSubmodule* sub;
	GitgCommit* commit;
	gboolean result;
	GitgStage* stage;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgRepository* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgStage* _tmp6_;
	GitgStage* _tmp7_;
	GitgStage* _tmp8_;
	GgitSubmoduleStatus _tmp9_;
	GgitSubmoduleStatus _tmp10_;
	GitgStage* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GError* e;
	gchar* msg;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	GitgExtApplication* _tmp20_;
	GitgExtApplication* _tmp21_;
	GitgExtApplication* _tmp22_;
	const gchar* _tmp23_;
	GError* _tmp24_;
	const gchar* _tmp25_;
	GitgRepository* repo;
	GgitRepository* _tmp26_;
	GgitSubmodule* _tmp27_;
	GgitSubmodule* _tmp28_;
	GgitRepository* _tmp29_;
	GitgRepository* _tmp30_;
	GError* _vala1_e;
	gchar* _vala1_msg;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	GitgExtApplication* _tmp36_;
	GitgExtApplication* _tmp37_;
	GitgExtApplication* _tmp38_;
	const gchar* _tmp39_;
	GError* _tmp40_;
	const gchar* _tmp41_;
	GgitCommit* sub_commit;
	GgitCommit* _tmp42_;
	GgitCommit* _tmp43_;
	GitgCommit* _tmp44_;
	GitgRepository* _tmp45_;
	GgitSubmodule* _tmp46_;
	GgitSubmodule* _tmp47_;
	GgitOId* _tmp48_;
	GgitOId* _tmp49_;
	gpointer _tmp50_;
	GitgCommit* _tmp51_;
	GitgCommit* _tmp52_;
	GError* _vala2_e;
	gchar* _vala2_msg;
	gchar* _tmp53_;
	gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
	GitgExtApplication* _tmp58_;
	GitgExtApplication* _tmp59_;
	GitgExtApplication* _tmp60_;
	const gchar* _tmp61_;
	GError* _tmp62_;
	const gchar* _tmp63_;
	GitgStage* _tmp64_;
	gchar* _tmp65_;
	gchar* _tmp66_;
	gchar* _tmp67_;
	GgitCommit* _tmp68_;
	GError* _vala3_e;
	gchar* _vala3_msg;
	gchar* _tmp69_;
	gchar* _tmp70_;
	gchar* _tmp71_;
	gchar* _tmp72_;
	gchar* _tmp73_;
	GitgExtApplication* _tmp74_;
	GitgExtApplication* _tmp75_;
	GitgExtApplication* _tmp76_;
	const gchar* _tmp77_;
	GError* _tmp78_;
	const gchar* _tmp79_;
	GError* _inner_error0_;
};

struct _GitgCommitActivityStageFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GitgStageStatusFile* file;
	gboolean result;
	GitgStage* stage;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgRepository* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgStage* _tmp6_;
	GitgStage* _tmp7_;
	GitgStage* _tmp8_;
	GgitStatusFlags _tmp9_;
	GgitStatusFlags _tmp10_;
	GitgStage* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GError* e;
	gchar* msg;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	GitgExtApplication* _tmp20_;
	GitgExtApplication* _tmp21_;
	GitgExtApplication* _tmp22_;
	const gchar* _tmp23_;
	GError* _tmp24_;
	const gchar* _tmp25_;
	GitgStage* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	GError* _vala1_e;
	gchar* _vala1_msg;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	GitgExtApplication* _tmp35_;
	GitgExtApplication* _tmp36_;
	GitgExtApplication* _tmp37_;
	const gchar* _tmp38_;
	GError* _tmp39_;
	const gchar* _tmp40_;
	GError* _inner_error0_;
};

struct _GitgCommitActivityStageItemsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GitgStageStatusItem** items;
	gint items_length1;
	GitgStageStatusItem** item_collection;
	gint item_collection_length1;
	gint _item_collection_size_;
	gint item_it;
	GitgStageStatusItem* _tmp0_;
	GitgStageStatusItem* item;
	gboolean ok;
	GitgStageStatusItem* _tmp1_;
	GitgStageStatusItem* _tmp2_;
	GitgStageStatusItem* _tmp3_;
	GitgStageStatusItem* _tmp4_;
};

struct _Block19Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgRepository* repository;
	GitgDiffView* view;
	GitgStageStatusItem** items;
	gint items_length1;
	gboolean patchable;
};

struct _Block20Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgStage* stage;
	GitgDiffView* view;
	gboolean patchable;
};

struct _GitgCommitActivityUnstageItemData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GitgStageStatusItem* item;
	gboolean isnew;
	gchar* removal_msg;
	gchar* unstage_msg;
	gboolean result;
	GitgStage* stage;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgRepository* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgStage* _tmp6_;
	GitgStage* _tmp7_;
	GitgStage* _tmp8_;
	GitgStage* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	GError* e;
	GitgExtApplication* _tmp13_;
	GitgExtApplication* _tmp14_;
	GitgExtApplication* _tmp15_;
	GError* _tmp16_;
	const gchar* _tmp17_;
	GitgStage* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	GError* _vala1_e;
	GitgExtApplication* _tmp22_;
	GitgExtApplication* _tmp23_;
	GitgExtApplication* _tmp24_;
	GError* _tmp25_;
	const gchar* _tmp26_;
	GError* _inner_error0_;
};

struct _GitgCommitActivityUnstageFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GitgStageStatusFile* file;
	gboolean result;
	GgitStatusFlags _tmp0_;
	GgitStatusFlags _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gboolean _tmp12_;
};

struct _GitgCommitActivityUnstageSubmoduleData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GitgStageStatusSubmodule* sub;
	gboolean result;
	GgitSubmoduleStatus _tmp0_;
	GgitSubmoduleStatus _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gboolean _tmp12_;
};

struct _GitgCommitActivityUnstageItemsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GitgStageStatusItem** items;
	gint items_length1;
	GitgStageStatusItem** item_collection;
	gint item_collection_length1;
	gint _item_collection_size_;
	gint item_it;
	GitgStageStatusItem* _tmp0_;
	GitgStageStatusItem* item;
	gboolean ok;
	GitgStageStatusItem* _tmp1_;
	GitgStageStatusItem* _tmp2_;
	GitgStageStatusItem* _tmp3_;
	GitgStageStatusItem* _tmp4_;
};

struct _Block21Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgCommitActivityStageUnstageCallback callback;
	gpointer callback_target;
};

struct _Block22Data {
	int _ref_count_;
	Block21Data * _data21_;
	GitgCommitSidebarItem* sitem;
};

struct _Block23Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgSidebarStore* model;
	GitgCommitSidebarItemType selected_type;
	GeeHashSet* selected_paths;
	GitgStageStatusEnumerator* enumerator;
};

struct _Block24Data {
	int _ref_count_;
	Block23Data * _data23_;
	GitgAvatarCache* ac;
};

struct _Block25Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgStage* stage;
	GitgCommitDialog* dlg;
};

struct _GitgCommitActivityPreCommitData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GgitSignature* author;
	gboolean result;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgRepository* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgStage* _tmp6_;
	GitgStage* _tmp7_;
	GitgStage* _tmp8_;
	GError* e;
	GitgExtApplication* _tmp9_;
	GitgExtApplication* _tmp10_;
	GitgExtApplication* _tmp11_;
	GError* _tmp12_;
	const gchar* _tmp13_;
	GError* _inner_error0_;
};

struct _Block26Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GgitDiffOptions* opts;
	GitgRepository* repository;
	GgitTree* tree;
	GgitDiff* diff;
	gpointer _async_data_;
};

struct _Block27Data {
	int _ref_count_;
	Block26Data * _data26_;
	GgitIndex* index;
};

struct _GitgCommitActivityIndexDiffData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GgitDiff* result;
	Block26Data* _data26_;
	GgitDiffOptions* _tmp0_;
	GgitDiffOptions* _tmp1_;
	GgitDiffOptions* _tmp2_;
	GgitDiffOptions* _tmp3_;
	GitgExtApplication* _tmp4_;
	GitgExtApplication* _tmp5_;
	GitgExtApplication* _tmp6_;
	GitgRepository* _tmp7_;
	GitgRepository* _tmp8_;
	GitgRepository* _tmp9_;
	GitgStage* stage;
	GitgRepository* _tmp10_;
	GitgStage* _tmp11_;
	GitgStage* _tmp12_;
	gboolean _tmp13_;
	GitgRepository* _tmp14_;
	GgitTree* _tmp15_;
	GitgStage* _tmp16_;
	GgitTree* _tmp17_;
	GgitTree* _tmp18_;
	Block27Data* _data27_;
	GitgRepository* _tmp19_;
	GgitIndex* _tmp20_;
	GgitDiff* _tmp21_;
	GgitDiff* _tmp22_;
	GError* _inner_error0_;
};

struct _Block28Data {
	int _ref_count_;
	GitgCommitActivity* self;
	gboolean skip_hooks;
	GgitSignature* author;
	GgitSignature* committer;
};

struct _Block29Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgCommitDialog* dlg;
	gboolean skip_hooks;
	GgitSignature* committer;
};

struct _Block30Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GgitSignature* committer;
	GgitSignature* author;
};

struct _GitgCommitActivityStageUnstageSelectionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	gboolean staging;
	GitgPatchSet** selection;
	GitgCommitPaned* _tmp0_;
	GitgDiffView* _tmp1_;
	GitgDiffView* _tmp2_;
	gint _tmp3_;
	GitgPatchSet** _tmp4_;
	gint selection_length1;
	gint _selection_size_;
	GitgStage* stage;
	GitgExtApplication* _tmp5_;
	GitgExtApplication* _tmp6_;
	GitgExtApplication* _tmp7_;
	GitgRepository* _tmp8_;
	GitgRepository* _tmp9_;
	GitgRepository* _tmp10_;
	GitgStage* _tmp11_;
	GitgStage* _tmp12_;
	GitgStage* _tmp13_;
	GitgPatchSet** _tmp14_;
	gint _tmp14__length1;
	GitgPatchSet** pset_collection;
	gint pset_collection_length1;
	gint _pset_collection_size_;
	gint pset_it;
	GitgPatchSet* _tmp15_;
	GitgPatchSet* pset;
	GitgPatchSet* _tmp16_;
	GitgPatchSetPatch* _tmp17_;
	gint _tmp17__length1;
	GitgStage* _tmp18_;
	GitgPatchSet* _tmp19_;
	GitgStage* _tmp20_;
	GitgPatchSet* _tmp21_;
	GitgCommitPaned* _tmp22_;
	GitgDiffView* _tmp23_;
	GitgDiffView* _tmp24_;
	GError* _inner_error0_;
};

struct _GitgCommitActivityDiscardSelectionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GitgPatchSet** selection;
	GitgCommitPaned* _tmp0_;
	GitgDiffView* _tmp1_;
	GitgDiffView* _tmp2_;
	gint _tmp3_;
	GitgPatchSet** _tmp4_;
	gint selection_length1;
	gint _selection_size_;
	GitgStage* stage;
	GitgExtApplication* _tmp5_;
	GitgExtApplication* _tmp6_;
	GitgExtApplication* _tmp7_;
	GitgRepository* _tmp8_;
	GitgRepository* _tmp9_;
	GitgRepository* _tmp10_;
	GitgStage* _tmp11_;
	GitgStage* _tmp12_;
	GitgStage* _tmp13_;
	GitgPatchSet** _tmp14_;
	gint _tmp14__length1;
	GitgPatchSet** pset_collection;
	gint pset_collection_length1;
	gint _pset_collection_size_;
	gint pset_it;
	GitgPatchSet* _tmp15_;
	GitgPatchSet* pset;
	GitgStage* _tmp16_;
	GitgPatchSet* _tmp17_;
	GError* _inner_error0_;
};

struct _Block31Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgExtUserQuery* q;
};

struct _Block32Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgExtUserQuery* q;
};

struct _Block33Data {
	int _ref_count_;
	GitgCommitActivity* self;
	gboolean staging;
};

struct _GitgCommitActivityRevertPathsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	gchar** paths;
	gint paths_length1;
	GitgStage* stage;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgRepository* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgStage* _tmp6_;
	GitgStage* _tmp7_;
	GitgStage* _tmp8_;
	gchar** path_collection;
	gint path_collection_length1;
	gint _path_collection_size_;
	gint path_it;
	gchar* _tmp9_;
	gchar* path;
	GitgStage* _tmp10_;
	const gchar* _tmp11_;
	GError* _inner_error0_;
};

struct _Block34Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgExtUserQuery* q;
};

struct _Block35Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgExtUserQuery* q;
	GitgStageStatusItem** items;
	gint items_length1;
};

struct _Block36Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GSourceFunc cb;
	gpointer cb_target;
	GDestroyNotify cb_target_destroy_notify;
	GError* _error_;
	gint n;
	gpointer _async_data_;
};

struct _Block37Data {
	int _ref_count_;
	Block36Data * _data36_;
	GFile* file;
};

struct _GitgCommitActivityDeleteFilesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgCommitActivity* self;
	GFile** files;
	gint files_length1;
	Block36Data* _data36_;
	gint i;
	gboolean _tmp0_;
	Block37Data* _data37_;
	gint _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	GError* _tmp5_;
	GError* _tmp6_;
	GError* _tmp7_;
	GError* _inner_error0_;
};

struct _Block38Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgExtUserQuery* q;
};

struct _Block39Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgExtUserQuery* q;
	GitgStageStatusItem** items;
	gint items_length1;
};

struct _Block40Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgStageStatusItem** sitems;
	gint sitems_length1;
	gint _sitems_size_;
};

struct _Block41Data {
	int _ref_count_;
	GitgCommitActivity* self;
	GitgCommitListView* view;
	GitgCommitModel* model;
};

static gint GitgCommitActivity_private_offset;
static gpointer gitg_commit_activity_parent_class = NULL;
static GitgExtUIElementIface * gitg_commit_activity_gitg_ext_ui_element_parent_iface = NULL;
static GitgExtActivityIface * gitg_commit_activity_gitg_ext_activity_parent_iface = NULL;

VALA_EXTERN GType gitg_commit_activity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitActivity, g_object_unref)
VALA_EXTERN GType gitg_commit_paned_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitPaned, g_object_unref)
static GType gitg_commit_activity_ui_type_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GType gitg_commit_activity_index_type_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN GitgCommitActivity* gitg_commit_activity_new (GitgExtApplication* application);
VALA_EXTERN GitgCommitActivity* gitg_commit_activity_construct (GType object_type,
                                                    GitgExtApplication* application);
static void gitg_commit_activity_real_dispose (GObject* base);
static void gitg_commit_activity_repository_changed_externally (GitgCommitActivity* self,
                                                         GitgExtExternalChangeHint hint);
static void ____lambda37_ (GitgCommitActivity* self);
static void gitg_commit_activity_reload (GitgCommitActivity* self);
static void _____lambda37__gitg_when_mapped_on_mapped (gpointer self);
static gboolean gitg_commit_activity_real_is_default_for (GitgExtActivity* base,
                                                   const gchar* action);
static gboolean gitg_commit_activity_real_on_key_pressed (GitgExtActivity* base,
                                                   GdkEventKey* event);
static void gitg_commit_activity_on_commit_clicked (GitgCommitActivity* self);
static void gitg_commit_activity_show_unstaged_diff (GitgCommitActivity* self,
                                              GitgStageStatusItem** items,
                                              gint items_length1);
static void gitg_commit_activity_show_submodule_history (GitgCommitActivity* self,
                                                  GitgStageStatusSubmodule* sub,
                                                  GitgCommitActivityIndexType type);
static void gitg_commit_activity_show_ui (GitgCommitActivity* self,
                                   GitgCommitActivityUiType type);
static void gitg_commit_activity_show_unstaged_diff_intern (GitgCommitActivity* self,
                                                     GitgRepository* repository,
                                                     GitgDiffView* view,
                                                     GitgStageStatusItem** items,
                                                     gint items_length1,
                                                     gboolean patchable);
VALA_EXTERN GitgDiffView* gitg_commit_paned_get_diff_view (GitgCommitPaned* self);
static void gitg_commit_activity_set_unstaged_diff_update_callback (GitgCommitActivity* self,
                                                             GitgRepository* repository,
                                                             GitgDiffView* view,
                                                             GitgStageStatusItem** items,
                                                             gint items_length1,
                                                             gboolean patchable);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
static void __lambda60_ (Block17Data* _data17_);
static void ___lambda60__gitg_commit_activity_update_diff_callback (gpointer self);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
static void __lambda59_ (Block18Data* _data18_,
                  GObject* obj,
                  GAsyncResult* res);
VALA_EXTERN GtkButton* gitg_commit_paned_get_button_stage (GitgCommitPaned* self);
VALA_EXTERN GtkButton* gitg_commit_paned_get_button_discard (GitgCommitPaned* self);
static void ___lambda59__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static GitgStageStatusItem** _vala_array_dup3 (GitgStageStatusItem** self,
                                        gssize length);
static void gitg_commit_activity_stage_submodule_at (GitgCommitActivity* self,
                                              GitgCommit* commit);
static void gitg_commit_activity_stage_submodule (GitgCommitActivity* self,
                                           GitgStageStatusSubmodule* sub,
                                           GitgCommit* commit,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static gboolean gitg_commit_activity_stage_submodule_finish (GitgCommitActivity* self,
                                                      GAsyncResult* _res_);
static void __lambda56_ (GitgCommitActivity* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda56__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void gitg_commit_activity_stage_submodule_data_free (gpointer _data);
static gboolean gitg_commit_activity_stage_submodule_co (GitgCommitActivityStageSubmoduleData* _data_);
static void gitg_commit_activity_stage_submodule_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static void _vala_GgitOId_free (GgitOId* self);
static void gitg_commit_activity_stage_file_data_free (gpointer _data);
static void gitg_commit_activity_stage_file (GitgCommitActivity* self,
                                      GitgStageStatusFile* file,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
static gboolean gitg_commit_activity_stage_file_finish (GitgCommitActivity* self,
                                                 GAsyncResult* _res_);
static gboolean gitg_commit_activity_stage_file_co (GitgCommitActivityStageFileData* _data_);
static void gitg_commit_activity_stage_file_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void gitg_commit_activity_stage_items_data_free (gpointer _data);
static void gitg_commit_activity_stage_items (GitgCommitActivity* self,
                                       GitgStageStatusItem** items,
                                       gint items_length1,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
static void gitg_commit_activity_stage_items_finish (GitgCommitActivity* self,
                                              GAsyncResult* _res_);
static gboolean gitg_commit_activity_stage_items_co (GitgCommitActivityStageItemsData* _data_);
static void gitg_commit_activity_stage_items_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
VALA_EXTERN GType gitg_commit_submodule_history_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitSubmoduleHistoryView, g_object_unref)
VALA_EXTERN GitgCommitSubmoduleHistoryView* gitg_commit_paned_get_submodule_history_view (GitgCommitPaned* self);
VALA_EXTERN GType gitg_commit_submodule_diff_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitSubmoduleDiffView, g_object_unref)
VALA_EXTERN GitgCommitSubmoduleDiffView* gitg_commit_paned_get_submodule_diff_view (GitgCommitPaned* self);
VALA_EXTERN GType gitg_commit_submodule_info_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitSubmoduleInfo, g_object_unref)
VALA_EXTERN GitgCommitSubmoduleInfo* gitg_commit_submodule_diff_view_get_info (GitgCommitSubmoduleDiffView* self);
VALA_EXTERN void gitg_commit_submodule_info_set_submodule (GitgCommitSubmoduleInfo* self,
                                               GgitSubmodule* value);
VALA_EXTERN GitgDiffView* gitg_commit_submodule_diff_view_get_diff_view_staged (GitgCommitSubmoduleDiffView* self);
VALA_EXTERN GitgDiffView* gitg_commit_submodule_diff_view_get_diff_view_unstaged (GitgCommitSubmoduleDiffView* self);
VALA_EXTERN GitgCommitListView* gitg_commit_submodule_history_view_get_commit_list_view (GitgCommitSubmoduleHistoryView* self);
VALA_EXTERN GitgDiffView* gitg_commit_submodule_history_view_get_diff_view (GitgCommitSubmoduleHistoryView* self);
static void gitg_commit_activity_on_unstaged_activated (GitgCommitActivity* self,
                                                 GitgStageStatusItem** items,
                                                 gint items_length1);
static GitgStageStatusItem** _vala_array_dup4 (GitgStageStatusItem** self,
                                        gssize length);
static void __lambda46_ (GitgCommitActivity* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda46__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void gitg_commit_activity_show_submodule_diff (GitgCommitActivity* self,
                                               GitgStageStatusSubmodule* sub);
static void gitg_commit_activity_show_staged_diff_intern (GitgCommitActivity* self,
                                                   GitgRepository* repository,
                                                   GitgDiffView* view,
                                                   GitgStageStatusItem** items,
                                                   gint items_length1,
                                                   gboolean patchable);
static void gitg_commit_activity_submodule_history_selection_changed (GitgCommitActivity* self,
                                                               GitgCommit* commit);
static GgitOId* _vala_GgitOId_copy (GgitOId* self);
static void ___lambda55_ (GitgCommitActivity* self,
                   GitgCommit* commit);
static void gitg_commit_activity_unstage_submodule_at (GitgCommitActivity* self,
                                                GitgCommit* commit);
static void ____lambda55__gitg_commit_activity_stage_unstage_submodule_commit_callback (GitgCommit* commit,
                                                                                 gpointer self);
static void ___lambda58_ (GitgCommitActivity* self,
                   GitgCommit* commit);
static void ____lambda58__gitg_commit_activity_stage_unstage_submodule_commit_callback (GitgCommit* commit,
                                                                                 gpointer self);
static void gitg_commit_activity_set_staged_diff_update_callback (GitgCommitActivity* self,
                                                           GitgRepository* repository,
                                                           GitgDiffView* view,
                                                           GitgStageStatusItem** items,
                                                           gint items_length1,
                                                           gboolean patchable);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
static void __lambda62_ (Block19Data* _data19_);
static void ___lambda62__gitg_commit_activity_update_diff_callback (gpointer self);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
static void __lambda61_ (Block20Data* _data20_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda61__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static GitgStageStatusItem** _vala_array_dup5 (GitgStageStatusItem** self,
                                        gssize length);
static void gitg_commit_activity_show_staged_diff (GitgCommitActivity* self,
                                            GitgStageStatusItem** items,
                                            gint items_length1);
static void gitg_commit_activity_unstage_item_data_free (gpointer _data);
static void gitg_commit_activity_unstage_item (GitgCommitActivity* self,
                                        GitgStageStatusItem* item,
                                        gboolean isnew,
                                        const gchar* removal_msg,
                                        const gchar* unstage_msg,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static gboolean gitg_commit_activity_unstage_item_finish (GitgCommitActivity* self,
                                                   GAsyncResult* _res_);
static gboolean gitg_commit_activity_unstage_item_co (GitgCommitActivityUnstageItemData* _data_);
static void gitg_commit_activity_unstage_item_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void gitg_commit_activity_unstage_file_data_free (gpointer _data);
static void gitg_commit_activity_unstage_file (GitgCommitActivity* self,
                                        GitgStageStatusFile* file,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static gboolean gitg_commit_activity_unstage_file_finish (GitgCommitActivity* self,
                                                   GAsyncResult* _res_);
static gboolean gitg_commit_activity_unstage_file_co (GitgCommitActivityUnstageFileData* _data_);
static void gitg_commit_activity_unstage_file_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void gitg_commit_activity_unstage_submodule_data_free (gpointer _data);
static void gitg_commit_activity_unstage_submodule (GitgCommitActivity* self,
                                             GitgStageStatusSubmodule* sub,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static gboolean gitg_commit_activity_unstage_submodule_finish (GitgCommitActivity* self,
                                                        GAsyncResult* _res_);
static gboolean gitg_commit_activity_unstage_submodule_co (GitgCommitActivityUnstageSubmoduleData* _data_);
static void gitg_commit_activity_unstage_submodule_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void ___lambda57_ (GitgCommitActivity* self,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda57__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void gitg_commit_activity_unstage_items_data_free (gpointer _data);
static void gitg_commit_activity_unstage_items (GitgCommitActivity* self,
                                         GitgStageStatusItem** items,
                                         gint items_length1,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static void gitg_commit_activity_unstage_items_finish (GitgCommitActivity* self,
                                                GAsyncResult* _res_);
static gboolean gitg_commit_activity_unstage_items_co (GitgCommitActivityUnstageItemsData* _data_);
static void gitg_commit_activity_unstage_items_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void gitg_commit_activity_on_staged_activated (GitgCommitActivity* self,
                                               GitgStageStatusItem** items,
                                               gint items_length1);
static GitgStageStatusItem** _vala_array_dup6 (GitgStageStatusItem** self,
                                        gssize length);
static void __lambda41_ (GitgCommitActivity* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda41__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
VALA_EXTERN GType gitg_commit_sidebar_item_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType gitg_commit_sidebar_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitSidebarItem, g_object_unref)
static GitgCommitSidebarItem** gitg_commit_activity_append_items (GitgCommitActivity* self,
                                                           GitgSidebarStore* model,
                                                           GitgStageStatusItem** items,
                                                           gint items_length1,
                                                           GitgCommitSidebarItemType type,
                                                           GeeHashSet* selected_paths,
                                                           GitgCommitActivityStageUnstageCallback callback,
                                                           gpointer callback_target,
                                                           gint* result_length1);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
static GitgStageStatusItem** _vala_array_dup7 (GitgStageStatusItem** self,
                                        gssize length);
static gint __lambda42_ (GitgCommitActivity* self,
                  GitgStageStatusItem* a,
                  GitgStageStatusItem* b);
static gint ___lambda42__gcompare_data_func (gconstpointer a,
                                      gconstpointer b,
                                      gpointer self);
VALA_EXTERN GtkSearchEntry* gitg_commit_paned_get_commit_files_search_entry (GitgCommitPaned* self);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
VALA_EXTERN GitgCommitSidebarItem* gitg_commit_sidebar_item_new (GitgStageStatusItem* item,
                                                     GitgCommitSidebarItemType type);
VALA_EXTERN GitgCommitSidebarItem* gitg_commit_sidebar_item_construct (GType object_type,
                                                           GitgStageStatusItem* item,
                                                           GitgCommitSidebarItemType type);
static void _vala_array_add7 (GitgCommitSidebarItem** * array,
                       gint* length,
                       gint* size,
                       GitgCommitSidebarItem* value);
static void ____lambda43_ (Block22Data* _data22_,
                    gint numclick);
static void _____lambda43__gitg_sidebar_item_activated (GitgSidebarItem* _sender,
                                                 gint numclick,
                                                 gpointer self);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
VALA_EXTERN GType gitg_commit_sidebar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitSidebar, g_object_unref)
VALA_EXTERN GitgCommitSidebar* gitg_commit_paned_get_sidebar (GitgCommitPaned* self);
static GitgStageStatusItem** gitg_commit_activity_items_for_items (GitgCommitActivity* self,
                                                            GitgSidebarItem** items,
                                                            gint items_length1,
                                                            GitgCommitSidebarItemType* type,
                                                            gint* result_length1);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static GgitSignature* gitg_commit_activity_get_signature (GitgCommitActivity* self,
                                                   const gchar* envname,
                                                   GError** error);
static void ____lambda38_ (Block24Data* _data24_,
                    GObject* obj,
                    GAsyncResult* res);
static void _____lambda38__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static void __lambda39_ (Block23Data* _data23_,
                  GObject* obj,
                  GAsyncResult* res);
static void _vala_array_add8 (GitgStageStatusItem** * array,
                       gint* length,
                       gint* size,
                       GitgStageStatusItem* value);
static void _vala_array_add9 (GitgStageStatusItem** * array,
                       gint* length,
                       gint* size,
                       GitgStageStatusItem* value);
static void _vala_array_add10 (GitgStageStatusItem** * array,
                        gint* length,
                        gint* size,
                        GitgStageStatusItem* value);
static void _vala_array_add11 (GitgStageStatusItem** * array,
                        gint* length,
                        gint* size,
                        GitgStageStatusItem* value);
static void __lambda40_ (GitgCommitActivity* self,
                  gint numclick);
static void gitg_commit_activity_on_unstage_selected_items (GitgCommitActivity* self);
static void ___lambda40__gitg_sidebar_item_activated (GitgSidebarItem* _sender,
                                               gint numclick,
                                               gpointer self);
static void ___lambda44_ (GitgCommitActivity* self,
                   GitgCommitSidebarItem* item);
VALA_EXTERN GitgStageStatusItem* gitg_commit_sidebar_item_get_item (GitgCommitSidebarItem* self);
static void ____lambda44__gitg_commit_activity_stage_unstage_callback (GitgCommitSidebarItem* item,
                                                                gpointer self);
static void __lambda45_ (GitgCommitActivity* self,
                  gint numclick);
static void gitg_commit_activity_on_stage_selected_items (GitgCommitActivity* self);
static void ___lambda45__gitg_sidebar_item_activated (GitgSidebarItem* _sender,
                                               gint numclick,
                                               gpointer self);
static void ___lambda47_ (GitgCommitActivity* self,
                   GitgCommitSidebarItem* item);
static void ____lambda47__gitg_commit_activity_stage_unstage_callback (GitgCommitSidebarItem* item,
                                                                gpointer self);
static void ___lambda48_ (GitgCommitActivity* self,
                   GitgCommitSidebarItem* item);
static void ____lambda48__gitg_commit_activity_stage_unstage_callback (GitgCommitSidebarItem* item,
                                                                gpointer self);
static void ____lambda49_ (GitgCommitActivity* self,
                    GitgCommitSidebarItem* item);
static void _____lambda49__gitg_commit_activity_stage_unstage_callback (GitgCommitSidebarItem* item,
                                                                 gpointer self);
static GitgCommitSidebarItem** _vala_array_dup8 (GitgCommitSidebarItem** self,
                                          gssize length);
static GitgCommitSidebarItem** _vala_array_dup9 (GitgCommitSidebarItem** self,
                                          gssize length);
static GitgCommitSidebarItem** _vala_array_dup10 (GitgCommitSidebarItem** self,
                                           gssize length);
static GitgCommitSidebarItem** _vala_array_dup11 (GitgCommitSidebarItem** self,
                                           gssize length);
static GitgCommitSidebarItem** _vala_array_dup12 (GitgCommitSidebarItem** self,
                                           gssize length);
static GitgCommitSidebarItem** _vala_array_dup13 (GitgCommitSidebarItem** self,
                                           gssize length);
static GitgCommitSidebarItem** _vala_array_dup14 (GitgCommitSidebarItem** self,
                                           gssize length);
static GitgCommitSidebarItem** _vala_array_dup15 (GitgCommitSidebarItem** self,
                                           gssize length);
static void ___lambda39__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void _vala_GgitStatusOptions_free (GgitStatusOptions* self);
static void gitg_commit_activity_real_activate (GitgExtUIElement* base);
VALA_EXTERN GType gitg_commit_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitDialog, g_object_unref)
static void gitg_commit_activity_do_commit (GitgCommitActivity* self,
                                     GitgCommitDialog* dlg,
                                     gboolean skip_hooks,
                                     GgitSignature* author,
                                     GgitSignature* committer);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
VALA_EXTERN gboolean gitg_commit_dialog_get_amend (GitgCommitDialog* self);
VALA_EXTERN void gitg_commit_dialog_show_infobar (GitgCommitDialog* self,
                                      const gchar* primary_msg,
                                      const gchar* secondary_msg,
                                      GtkMessageType type);
VALA_EXTERN gboolean gitg_commit_dialog_get_sign_off (GitgCommitDialog* self);
VALA_EXTERN gboolean gitg_commit_dialog_get_sign_commit (GitgCommitDialog* self);
VALA_EXTERN gchar* gitg_commit_dialog_get_pretty_message (GitgCommitDialog* self);
static void __lambda53_ (Block25Data* _data25_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda53__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void gitg_commit_activity_pre_commit_data_free (gpointer _data);
static void gitg_commit_activity_pre_commit (GitgCommitActivity* self,
                                      GgitSignature* author,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
static gboolean gitg_commit_activity_pre_commit_finish (GitgCommitActivity* self,
                                                 GAsyncResult* _res_);
static gboolean gitg_commit_activity_pre_commit_co (GitgCommitActivityPreCommitData* _data_);
static void gitg_commit_activity_pre_commit_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void gitg_commit_activity_index_diff_data_free (gpointer _data);
static void gitg_commit_activity_index_diff (GitgCommitActivity* self,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
static GgitDiff* gitg_commit_activity_index_diff_finish (GitgCommitActivity* self,
                                                  GAsyncResult* _res_);
static gboolean gitg_commit_activity_index_diff_co (GitgCommitActivityIndexDiffData* _data_);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
static void gitg_commit_activity_index_diff_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
static void ___lambda50_ (Block27Data* _data27_,
                   GError** error);
static void ____lambda50__gitg_async_thread_func (gpointer self,
                                           GError** error);
static void gitg_commit_activity_run_commit_dialog (GitgCommitActivity* self,
                                             gboolean skip_hooks,
                                             GgitSignature* author,
                                             GgitSignature* committer);
static Block28Data* block28_data_ref (Block28Data* _data28_);
static void block28_data_unref (void * _userdata_);
static void __lambda51_ (Block28Data* _data28_,
                  GObject* obj,
                  GAsyncResult* res);
static void gitg_commit_activity_run_commit_dialog_with_diff (GitgCommitActivity* self,
                                                       gboolean skip_hooks,
                                                       GgitSignature* author,
                                                       GgitSignature* committer,
                                                       GgitDiff* diff);
static void ___lambda51__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static Block29Data* block29_data_ref (Block29Data* _data29_);
static void block29_data_unref (void * _userdata_);
VALA_EXTERN GitgCommitDialog* gitg_commit_dialog_new (GitgRepository* repository,
                                          GgitSignature* author,
                                          GgitDiff* diff);
VALA_EXTERN GitgCommitDialog* gitg_commit_dialog_construct (GType object_type,
                                                GitgRepository* repository,
                                                GgitSignature* author,
                                                GgitDiff* diff);
static void __lambda52_ (Block29Data* _data29_,
                  GtkDialog* d,
                  gint id);
VALA_EXTERN GgitSignature* gitg_commit_dialog_get_author (GitgCommitDialog* self);
static void ___lambda52__gtk_dialog_response (GtkDialog* _sender,
                                       gint response_id,
                                       gpointer self);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
VALA_EXTERN gboolean gitg_commit_paned_get_skip_hooks (GitgCommitPaned* self);
static void ___lambda54_ (Block30Data* _data30_,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda54__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void gitg_commit_activity_stage_unstage_selection_data_free (gpointer _data);
static void gitg_commit_activity_stage_unstage_selection (GitgCommitActivity* self,
                                                   gboolean staging,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void gitg_commit_activity_stage_unstage_selection_finish (GitgCommitActivity* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
static gboolean gitg_commit_activity_stage_unstage_selection_co (GitgCommitActivityStageUnstageSelectionData* _data_);
static void gitg_commit_activity_stage_unstage_selection_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void gitg_commit_activity_discard_selection_data_free (gpointer _data);
static void gitg_commit_activity_discard_selection (GitgCommitActivity* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void gitg_commit_activity_discard_selection_finish (GitgCommitActivity* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static gboolean gitg_commit_activity_discard_selection_co (GitgCommitActivityDiscardSelectionData* _data_);
static void gitg_commit_activity_discard_selection_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void gitg_commit_activity_on_discard_clicked (GitgCommitActivity* self);
static Block31Data* block31_data_ref (Block31Data* _data31_);
static void block31_data_unref (void * _userdata_);
static gboolean __lambda63_ (Block31Data* _data31_,
                      GitgExtUserQuery* w,
                      GtkResponseType r);
static gboolean gitg_commit_activity_do_discard_selection (GitgCommitActivity* self,
                                                    GitgExtUserQuery* q);
static gboolean ___lambda63__gitg_ext_user_query_response (GitgExtUserQuery* _sender,
                                                    GtkResponseType response_type,
                                                    gpointer self);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
static void __lambda64_ (Block32Data* _data32_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda64__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void gitg_commit_activity_on_stage_clicked (GitgCommitActivity* self);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void __lambda65_ (Block33Data* _data33_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda65__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void gitg_commit_activity_revert_paths_data_free (gpointer _data);
static void gitg_commit_activity_revert_paths (GitgCommitActivity* self,
                                        gchar** paths,
                                        gint paths_length1,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static void gitg_commit_activity_revert_paths_finish (GitgCommitActivity* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean gitg_commit_activity_revert_paths_co (GitgCommitActivityRevertPathsData* _data_);
static void gitg_commit_activity_revert_paths_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void gitg_commit_activity_do_edit_items (GitgCommitActivity* self,
                                         GitgStageStatusItem** items,
                                         gint items_length1);
static gboolean gitg_commit_activity_do_discard_items (GitgCommitActivity* self,
                                                GitgExtUserQuery* q,
                                                GitgStageStatusItem** items,
                                                gint items_length1);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
static gchar** _vala_array_dup16 (gchar** self,
                           gssize length);
static void __lambda66_ (Block34Data* _data34_,
                  GObject* o,
                  GAsyncResult* ret);
static void ___lambda66__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void gitg_commit_activity_on_discard_menu_activated (GitgCommitActivity* self,
                                                     GitgStageStatusItem** items,
                                                     gint items_length1);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
static gboolean __lambda67_ (Block35Data* _data35_,
                      GitgExtUserQuery* w,
                      GtkResponseType r);
static gboolean ___lambda67__gitg_ext_user_query_response (GitgExtUserQuery* _sender,
                                                    GtkResponseType response_type,
                                                    gpointer self);
static void gitg_commit_activity_delete_files_data_free (gpointer _data);
static void gitg_commit_activity_delete_files (GitgCommitActivity* self,
                                        GFile** files,
                                        gint files_length1,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static void gitg_commit_activity_delete_files_finish (GitgCommitActivity* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean gitg_commit_activity_delete_files_co (GitgCommitActivityDeleteFilesData* _data_);
static Block36Data* block36_data_ref (Block36Data* _data36_);
static void block36_data_unref (void * _userdata_);
static gboolean _gitg_commit_activity_delete_files_co_gsource_func (gpointer self);
static Block37Data* block37_data_ref (Block37Data* _data37_);
static void block37_data_unref (void * _userdata_);
static void _____lambda68_ (Block37Data* _data37_,
                     GObject* o,
                     GAsyncResult* res);
static void ______lambda68__gasync_ready_callback (GObject* source_object,
                                            GAsyncResult* res,
                                            gpointer self);
static gboolean gitg_commit_activity_do_delete_items (GitgCommitActivity* self,
                                               GitgExtUserQuery* q,
                                               GitgStageStatusItem** items,
                                               gint items_length1);
static Block38Data* block38_data_ref (Block38Data* _data38_);
static void block38_data_unref (void * _userdata_);
static void __lambda69_ (Block38Data* _data38_,
                  GObject* o,
                  GAsyncResult* ret);
static void ___lambda69__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void gitg_commit_activity_on_delete_menu_activated (GitgCommitActivity* self,
                                                    GitgStageStatusItem** items,
                                                    gint items_length1);
static Block39Data* block39_data_ref (Block39Data* _data39_);
static void block39_data_unref (void * _userdata_);
static gboolean __lambda70_ (Block39Data* _data39_,
                      GitgExtUserQuery* w,
                      GtkResponseType r);
static gboolean ___lambda70__gitg_ext_user_query_response (GitgExtUserQuery* _sender,
                                                    GtkResponseType response_type,
                                                    gpointer self);
static void gitg_commit_activity_do_populate_menu (GitgCommitActivity* self,
                                            GtkMenu* menu);
static Block40Data* block40_data_ref (Block40Data* _data40_);
static void block40_data_unref (void * _userdata_);
static void ___lambda71_ (Block40Data* _data40_);
static void ____lambda71__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda72_ (Block40Data* _data40_);
static void ____lambda72__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda73_ (Block40Data* _data40_);
static void ____lambda73__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda74_ (Block40Data* _data40_);
static void ____lambda74__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda75_ (Block40Data* _data40_);
static void ____lambda75__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static GitgStageStatusItem** gitg_commit_activity_items_to_stage_items (GitgCommitActivity* self,
                                                                 GitgCommitSidebarItem** items,
                                                                 gint items_length1,
                                                                 gint* result_length1);
static GitgStageStatusItem** gitg_commit_activity_stage_status_items_of_type (GitgCommitActivity* self,
                                                                       GitgCommitSidebarItemType type,
                                                                       gint* result_length1);
VALA_EXTERN GitgCommitSidebarItem** gitg_commit_sidebar_items_of_type (GitgCommitSidebar* self,
                                                           GitgCommitSidebarItemType type,
                                                           gint* result_length1);
static void _vala_array_add12 (GitgStageStatusItem** * array,
                        gint* length,
                        gint* size,
                        GitgStageStatusItem* value);
VALA_EXTERN GitgCommitSidebarItemType gitg_commit_sidebar_item_get_stage_type (GitgCommitSidebarItem* self);
static void gitg_commit_activity_sidebar_selection_changed (GitgCommitActivity* self,
                                                     GitgSidebarItem** items,
                                                     gint items_length1);
static void gitg_commit_activity_build_ui (GitgCommitActivity* self);
static Block41Data* block41_data_ref (Block41Data* _data41_);
static void block41_data_unref (void * _userdata_);
VALA_EXTERN GitgCommitPaned* gitg_commit_paned_new (void);
VALA_EXTERN GitgCommitPaned* gitg_commit_paned_construct (GType object_type);
static void __lambda76_ (GitgCommitActivity* self);
static void ___lambda76__gitg_diff_view_options_changed (GitgDiffView* _sender,
                                                  gpointer self);
static void __lambda77_ (GitgCommitActivity* self);
static void ___lambda77__gitg_sidebar_deselected (GitgSidebar* _sender,
                                           gpointer self);
static void _gitg_commit_activity_on_stage_selected_items_gitg_commit_sidebar_stage_selection (GitgCommitSidebar* _sender,
                                                                                        gpointer self);
static void _gitg_commit_activity_on_unstage_selected_items_gitg_commit_sidebar_unstage_selection (GitgCommitSidebar* _sender,
                                                                                            gpointer self);
static void __lambda78_ (GitgCommitActivity* self);
static void ___lambda78__gitg_commit_sidebar_discard_selection (GitgCommitSidebar* _sender,
                                                         gpointer self);
static void __lambda79_ (GitgCommitActivity* self);
static void ___lambda79__gitg_commit_sidebar_edit_selection (GitgCommitSidebar* _sender,
                                                      gpointer self);
static void _gitg_commit_activity_sidebar_selection_changed_gitg_commit_sidebar_selected_items_changed (GitgCommitSidebar* _sender,
                                                                                                 GitgSidebarItem** items,
                                                                                                 gint items_length1,
                                                                                                 gpointer self);
VALA_EXTERN GtkButton* gitg_commit_paned_get_button_commit (GitgCommitPaned* self);
static void __lambda80_ (GitgCommitActivity* self);
static void ___lambda80__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda81_ (GitgCommitActivity* self);
static void ___lambda81__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda82_ (GitgCommitActivity* self);
static void ___lambda82__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda83_ (GitgCommitActivity* self,
                  GgitSubmodule* submodule);
static gboolean ___lambda84_ (GitgCommitActivity* self);
static gboolean ____lambda84__gtk_widget_delete_event (GtkWidget* _sender,
                                                GdkEventAny* event,
                                                gpointer self);
static void ___lambda83__gitg_commit_submodule_info_request_open_repository (GitgCommitSubmoduleInfo* _sender,
                                                                      GgitSubmodule* submodule,
                                                                      gpointer self);
static void _gitg_commit_activity_do_populate_menu_gitg_sidebar_populate_popup (GitgSidebar* _sender,
                                                                         GtkMenu* menu,
                                                                         gpointer self);
VALA_EXTERN GtkSearchBar* gitg_commit_paned_get_commit_files_search_bar (GitgCommitPaned* self);
static void __lambda85_ (GitgCommitActivity* self,
                  GtkSearchEntry* entry);
static void ___lambda85__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                   gpointer self);
static void __lambda86_ (GitgCommitActivity* self,
                  GtkSearchEntry* entry);
static void ___lambda86__gtk_search_entry_stop_search (GtkSearchEntry* _sender,
                                                gpointer self);
static void __lambda87_ (Block41Data* _data41_,
                  GtkTreeModel* model,
                  GtkTreePath* path,
                  GtkTreeIter* iter);
static void ___lambda87__gtk_tree_model_row_inserted (GtkTreeModel* _sender,
                                               GtkTreePath* path,
                                               GtkTreeIter* iter,
                                               gpointer self);
static void __lambda88_ (Block41Data* _data41_,
                  GtkTreeSelection* selection);
static void ___lambda88__gtk_tree_selection_changed (GtkTreeSelection* _sender,
                                              gpointer self);
static void __lambda89_ (Block41Data* _data41_,
                  GtkTreeView* view,
                  GtkTreePath* path,
                  GtkTreeViewColumn* column);
static void ___lambda89__gtk_tree_view_row_activated (GtkTreeView* _sender,
                                               GtkTreePath* path,
                                               GtkTreeViewColumn* column,
                                               gpointer self);
VALA_EXTERN void gitg_commit_activity_set_repository (GitgCommitActivity* self,
                                          GitgRepository* value);
static GObject * gitg_commit_activity_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static void _gitg_commit_activity_repository_changed_externally_gitg_ext_application_repository_changed_externally (GitgExtApplication* _sender,
                                                                                                             GitgExtExternalChangeHint hint,
                                                                                                             gpointer self);
static void gitg_commit_activity_finalize (GObject * obj);
static GType gitg_commit_activity_get_type_once (void);
static void _vala_gitg_commit_activity_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_gitg_commit_activity_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
gitg_commit_activity_get_instance_private (GitgCommitActivity* self)
{
	return G_STRUCT_MEMBER_P (self, GitgCommitActivity_private_offset);
}

 G_GNUC_NO_INLINE static GType
gitg_commit_activity_ui_type_get_type_once (void)
{
	static const GEnumValue values[] = {{GITG_COMMIT_ACTIVITY_UI_TYPE_DIFF, "GITG_COMMIT_ACTIVITY_UI_TYPE_DIFF", "diff"}, {GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_HISTORY, "GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_HISTORY", "submodule-history"}, {GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_DIFF, "GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_DIFF", "submodule-diff"}, {0, NULL, NULL}};
	GType gitg_commit_activity_ui_type_type_id;
	gitg_commit_activity_ui_type_type_id = g_enum_register_static ("GitgCommitActivityUiType", values);
	return gitg_commit_activity_ui_type_type_id;
}

static GType
gitg_commit_activity_ui_type_get_type (void)
{
	static gsize gitg_commit_activity_ui_type_type_id__once = 0;
	if (g_once_init_enter (&gitg_commit_activity_ui_type_type_id__once)) {
		GType gitg_commit_activity_ui_type_type_id;
		gitg_commit_activity_ui_type_type_id = gitg_commit_activity_ui_type_get_type_once ();
		g_once_init_leave (&gitg_commit_activity_ui_type_type_id__once, gitg_commit_activity_ui_type_type_id);
	}
	return gitg_commit_activity_ui_type_type_id__once;
}

 G_GNUC_NO_INLINE static GType
gitg_commit_activity_index_type_get_type_once (void)
{
	static const GEnumValue values[] = {{GITG_COMMIT_ACTIVITY_INDEX_TYPE_STAGED, "GITG_COMMIT_ACTIVITY_INDEX_TYPE_STAGED", "staged"}, {GITG_COMMIT_ACTIVITY_INDEX_TYPE_UNSTAGED, "GITG_COMMIT_ACTIVITY_INDEX_TYPE_UNSTAGED", "unstaged"}, {0, NULL, NULL}};
	GType gitg_commit_activity_index_type_type_id;
	gitg_commit_activity_index_type_type_id = g_enum_register_static ("GitgCommitActivityIndexType", values);
	return gitg_commit_activity_index_type_type_id;
}

static GType
gitg_commit_activity_index_type_get_type (void)
{
	static gsize gitg_commit_activity_index_type_type_id__once = 0;
	if (g_once_init_enter (&gitg_commit_activity_index_type_type_id__once)) {
		GType gitg_commit_activity_index_type_type_id;
		gitg_commit_activity_index_type_type_id = gitg_commit_activity_index_type_get_type_once ();
		g_once_init_leave (&gitg_commit_activity_index_type_type_id__once, gitg_commit_activity_index_type_type_id);
	}
	return gitg_commit_activity_index_type_type_id__once;
}

GitgCommitActivity*
gitg_commit_activity_construct (GType object_type,
                                GitgExtApplication* application)
{
	GitgCommitActivity * self = NULL;
	g_return_val_if_fail (application != NULL, NULL);
	self = (GitgCommitActivity*) g_object_new (object_type, "application", application, NULL);
	return self;
}

GitgCommitActivity*
gitg_commit_activity_new (GitgExtApplication* application)
{
	return gitg_commit_activity_construct (GITG_COMMIT_TYPE_ACTIVITY, application);
}

static void
gitg_commit_activity_real_dispose (GObject* base)
{
	GitgCommitActivity * self;
	self = (GitgCommitActivity*) base;
	if (self->priv->d_externally_changed_id != ((gulong) 0)) {
		GitgExtApplication* _tmp0_;
		GitgExtApplication* _tmp1_;
		GitgExtApplication* _tmp2_;
		_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		g_signal_handler_disconnect ((GObject*) _tmp2_, self->priv->d_externally_changed_id);
		_g_object_unref0 (_tmp2_);
		self->priv->d_externally_changed_id = (gulong) 0;
	}
	G_OBJECT_CLASS (gitg_commit_activity_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

static void
____lambda37_ (GitgCommitActivity* self)
{
	gitg_commit_activity_reload (self);
}

static void
_____lambda37__gitg_when_mapped_on_mapped (gpointer self)
{
	____lambda37_ ((GitgCommitActivity*) self);
}

static void
gitg_commit_activity_repository_changed_externally (GitgCommitActivity* self,
                                                    GitgExtExternalChangeHint hint)
{
	g_return_if_fail (self != NULL);
	if (!self->priv->d_ignore_external_changes) {
		gboolean _tmp0_ = FALSE;
		GitgCommitPaned* _tmp1_;
		_tmp1_ = self->priv->d_main;
		if (_tmp1_ != NULL) {
			_tmp0_ = (hint & GITG_EXT_EXTERNAL_CHANGE_HINT_INDEX) != 0;
		} else {
			_tmp0_ = FALSE;
		}
		if (_tmp0_) {
			GitgCommitPaned* _tmp2_;
			GitgWhenMapped* _tmp3_;
			GitgWhenMapped* _tmp4_;
			_tmp2_ = self->priv->d_main;
			_tmp3_ = gitg_when_mapped_new ((GtkWidget*) _tmp2_);
			_gitg_when_mapped_unref0 (self->priv->d_reload_when_mapped);
			self->priv->d_reload_when_mapped = _tmp3_;
			_tmp4_ = self->priv->d_reload_when_mapped;
			gitg_when_mapped_update (_tmp4_, _____lambda37__gitg_when_mapped_on_mapped, g_object_ref (self), g_object_unref, (GObject*) self);
		}
	}
	self->priv->d_ignore_external_changes = FALSE;
}

static gboolean
gitg_commit_activity_real_is_default_for (GitgExtActivity* base,
                                          const gchar* action)
{
	GitgCommitActivity * self;
	gboolean result;
	self = (GitgCommitActivity*) base;
	g_return_val_if_fail (action != NULL, FALSE);
	result = g_strcmp0 (action, "commit") == 0;
	return result;
}

static gboolean
gitg_commit_activity_real_on_key_pressed (GitgExtActivity* base,
                                          GdkEventKey* event)
{
	GitgCommitActivity * self;
	GdkModifierType mmask = 0U;
	gboolean result;
	self = (GitgCommitActivity*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	mmask = gtk_accelerator_get_default_mod_mask ();
	if ((mmask & event->state) == GDK_CONTROL_MASK) {
		gboolean _tmp0_ = FALSE;
		if (event->keyval == GDK_KEY_Return) {
			_tmp0_ = TRUE;
		} else {
			_tmp0_ = event->keyval == GDK_KEY_KP_Enter;
		}
		if (_tmp0_) {
			gitg_commit_activity_on_commit_clicked (self);
			result = TRUE;
			return result;
		}
	}
	result = FALSE;
	return result;
}

static void
gitg_commit_activity_show_unstaged_diff (GitgCommitActivity* self,
                                         GitgStageStatusItem** items,
                                         gint items_length1)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (items_length1 == 1) {
		GitgStageStatusItem* _tmp1_;
		_tmp1_ = items[0];
		_tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GITG_TYPE_STAGE_STATUS_SUBMODULE);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GitgStageStatusItem* _tmp2_;
		_tmp2_ = items[0];
		gitg_commit_activity_show_submodule_history (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GITG_TYPE_STAGE_STATUS_SUBMODULE, GitgStageStatusSubmodule), GITG_COMMIT_ACTIVITY_INDEX_TYPE_UNSTAGED);
	} else {
		GitgExtApplication* _tmp3_;
		GitgExtApplication* _tmp4_;
		GitgExtApplication* _tmp5_;
		GitgRepository* _tmp6_;
		GitgRepository* _tmp7_;
		GitgRepository* _tmp8_;
		GitgCommitPaned* _tmp9_;
		GitgDiffView* _tmp10_;
		GitgDiffView* _tmp11_;
		gitg_commit_activity_show_ui (self, GITG_COMMIT_ACTIVITY_UI_TYPE_DIFF);
		_tmp3_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = gitg_ext_application_get_repository (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = self->priv->d_main;
		_tmp10_ = gitg_commit_paned_get_diff_view (_tmp9_);
		_tmp11_ = _tmp10_;
		gitg_commit_activity_show_unstaged_diff_intern (self, _tmp8_, _tmp11_, items, (gint) items_length1, TRUE);
		_g_object_unref0 (_tmp8_);
		_g_object_unref0 (_tmp5_);
	}
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static Block17Data*
block17_data_ref (Block17Data* _data17_)
{
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}

static void
block17_data_unref (void * _userdata_)
{
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data17_->self;
		_g_object_unref0 (_data17_->repository);
		_g_object_unref0 (_data17_->view);
		_data17_->items = (_vala_array_free (_data17_->items, _data17_->items_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block17Data, _data17_);
	}
}

static void
__lambda60_ (Block17Data* _data17_)
{
	GitgCommitActivity* self;
	self = _data17_->self;
	gitg_commit_activity_show_unstaged_diff_intern (self, _data17_->repository, _data17_->view, _data17_->items, (gint) _data17_->items_length1, _data17_->patchable);
}

static void
___lambda60__gitg_commit_activity_update_diff_callback (gpointer self)
{
	__lambda60_ (self);
}

static void
gitg_commit_activity_set_unstaged_diff_update_callback (GitgCommitActivity* self,
                                                        GitgRepository* repository,
                                                        GitgDiffView* view,
                                                        GitgStageStatusItem** items,
                                                        gint items_length1,
                                                        gboolean patchable)
{
	Block17Data* _data17_;
	GitgRepository* _tmp0_;
	GitgDiffView* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (repository != NULL);
	g_return_if_fail (view != NULL);
	_data17_ = g_slice_new0 (Block17Data);
	_data17_->_ref_count_ = 1;
	_data17_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (repository);
	_g_object_unref0 (_data17_->repository);
	_data17_->repository = _tmp0_;
	_tmp1_ = _g_object_ref0 (view);
	_g_object_unref0 (_data17_->view);
	_data17_->view = _tmp1_;
	_data17_->items = (_vala_array_free (_data17_->items, _data17_->items_length1, (GDestroyNotify) g_object_unref), NULL);
	_data17_->items = items;
	_data17_->items_length1 = items_length1;
	_data17_->patchable = patchable;
	(self->priv->d_update_diff_callback_target_destroy_notify == NULL) ? NULL : (self->priv->d_update_diff_callback_target_destroy_notify (self->priv->d_update_diff_callback_target), NULL);
	self->priv->d_update_diff_callback = NULL;
	self->priv->d_update_diff_callback_target = NULL;
	self->priv->d_update_diff_callback_target_destroy_notify = NULL;
	self->priv->d_update_diff_callback = ___lambda60__gitg_commit_activity_update_diff_callback;
	self->priv->d_update_diff_callback_target = block17_data_ref (_data17_);
	self->priv->d_update_diff_callback_target_destroy_notify = block17_data_unref;
	block17_data_unref (_data17_);
	_data17_ = NULL;
}

static Block18Data*
block18_data_ref (Block18Data* _data18_)
{
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}

static void
block18_data_unref (void * _userdata_)
{
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data18_->self;
		_g_object_unref0 (_data18_->stage);
		_g_object_unref0 (_data18_->view);
		_g_object_unref0 (self);
		g_slice_free (Block18Data, _data18_);
	}
}

static void
__lambda59_ (Block18Data* _data18_,
             GObject* obj,
             GAsyncResult* res)
{
	GitgCommitActivity* self;
	GError* _inner_error0_ = NULL;
	self = _data18_->self;
	g_return_if_fail (res != NULL);
	{
		GgitDiff* d = NULL;
		GgitDiff* _tmp0_;
		GitgCommitPaned* _tmp1_;
		GtkButton* _tmp2_;
		GtkButton* _tmp3_;
		GitgCommitPaned* _tmp4_;
		GtkButton* _tmp5_;
		GtkButton* _tmp6_;
		GitgCommitPaned* _tmp7_;
		GtkButton* _tmp8_;
		GtkButton* _tmp9_;
		_tmp0_ = gitg_stage_diff_workdir_all_finish (_data18_->stage, res, &_inner_error0_);
		d = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		gitg_diff_view_set_unstaged (_data18_->view, _data18_->patchable);
		gitg_diff_view_set_staged (_data18_->view, FALSE);
		_tmp1_ = self->priv->d_main;
		_tmp2_ = gitg_commit_paned_get_button_stage (_tmp1_);
		_tmp3_ = _tmp2_;
		gtk_button_set_label (_tmp3_, _ ("_Stage selection"));
		_tmp4_ = self->priv->d_main;
		_tmp5_ = gitg_commit_paned_get_button_stage (_tmp4_);
		_tmp6_ = _tmp5_;
		gtk_widget_set_visible ((GtkWidget*) _tmp6_, _data18_->patchable);
		_tmp7_ = self->priv->d_main;
		_tmp8_ = gitg_commit_paned_get_button_discard (_tmp7_);
		_tmp9_ = _tmp8_;
		gtk_widget_set_visible ((GtkWidget*) _tmp9_, TRUE);
		gitg_diff_view_set_new_is_workdir (_data18_->view, TRUE);
		gitg_diff_view_set_diff (_data18_->view, d);
		_g_object_unref0 (d);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		gitg_diff_view_set_diff (_data18_->view, NULL);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda59__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda59_ (self, source_object, res);
	block18_data_unref (self);
}

static GitgStageStatusItem**
_vala_array_dup3 (GitgStageStatusItem** self,
                  gssize length)
{
	if (length >= 0) {
		GitgStageStatusItem** result;
		gssize i;
		result = g_new0 (GitgStageStatusItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgStageStatusItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
gitg_commit_activity_show_unstaged_diff_intern (GitgCommitActivity* self,
                                                GitgRepository* repository,
                                                GitgDiffView* view,
                                                GitgStageStatusItem** items,
                                                gint items_length1,
                                                gboolean patchable)
{
	Block18Data* _data18_;
	GitgDiffView* _tmp0_;
	GitgStage* _tmp1_;
	GitgStage* _tmp2_;
	GgitDiffOptions* _tmp3_;
	GgitDiffOptions* _tmp4_;
	GitgStageStatusItem** _tmp5_;
	gint _tmp5__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (repository != NULL);
	g_return_if_fail (view != NULL);
	_data18_ = g_slice_new0 (Block18Data);
	_data18_->_ref_count_ = 1;
	_data18_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (view);
	_g_object_unref0 (_data18_->view);
	_data18_->view = _tmp0_;
	_data18_->patchable = patchable;
	_tmp1_ = gitg_repository_get_stage (repository);
	_tmp2_ = _tmp1_;
	_data18_->stage = _tmp2_;
	_tmp3_ = gitg_diff_view_get_options (_data18_->view);
	_tmp4_ = _tmp3_;
	gitg_stage_diff_workdir_all (_data18_->stage, items, (gint) items_length1, _tmp4_, ___lambda59__gasync_ready_callback, block18_data_ref (_data18_));
	_tmp5_ = (items != NULL) ? _vala_array_dup3 (items, items_length1) : items;
	_tmp5__length1 = items_length1;
	gitg_commit_activity_set_unstaged_diff_update_callback (self, repository, _data18_->view, _tmp5_, (gint) _tmp5__length1, _data18_->patchable);
	block18_data_unref (_data18_);
	_data18_ = NULL;
}

static void
__lambda56_ (GitgCommitActivity* self,
             GObject* obj,
             GAsyncResult* res)
{
	g_return_if_fail (res != NULL);
	gitg_commit_activity_stage_submodule_finish (self, res);
	self->priv->d_ignore_external_changes = TRUE;
	gitg_commit_activity_reload (self);
}

static void
___lambda56__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda56_ ((GitgCommitActivity*) self, source_object, res);
	g_object_unref (self);
}

static void
gitg_commit_activity_stage_submodule_at (GitgCommitActivity* self,
                                         GitgCommit* commit)
{
	GitgStageStatusSubmodule* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (commit != NULL);
	_tmp0_ = self->priv->d_current_submodule;
	gitg_commit_activity_stage_submodule (self, _tmp0_, commit, ___lambda56__gasync_ready_callback, g_object_ref (self));
}

static void
gitg_commit_activity_stage_submodule_data_free (gpointer _data)
{
	GitgCommitActivityStageSubmoduleData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->sub);
	_g_object_unref0 (_data_->commit);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityStageSubmoduleData, _data_);
}

static void
gitg_commit_activity_stage_submodule (GitgCommitActivity* self,
                                      GitgStageStatusSubmodule* sub,
                                      GitgCommit* commit,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	GitgCommitActivityStageSubmoduleData* _data_;
	GitgCommitActivity* _tmp0_;
	GitgStageStatusSubmodule* _tmp1_;
	GitgCommit* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sub != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityStageSubmoduleData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_stage_submodule_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (sub);
	_g_object_unref0 (_data_->sub);
	_data_->sub = _tmp1_;
	_tmp2_ = _g_object_ref0 (commit);
	_g_object_unref0 (_data_->commit);
	_data_->commit = _tmp2_;
	gitg_commit_activity_stage_submodule_co (_data_);
}

static gboolean
gitg_commit_activity_stage_submodule_finish (GitgCommitActivity* self,
                                             GAsyncResult* _res_)
{
	gboolean result;
	GitgCommitActivityStageSubmoduleData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
gitg_commit_activity_stage_submodule_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	GitgCommitActivityStageSubmoduleData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_stage_submodule_co (_data_);
}

static void
_vala_GgitOId_free (GgitOId* self)
{
	g_boxed_free (ggit_oid_get_type (), self);
}

static gboolean
gitg_commit_activity_stage_submodule_co (GitgCommitActivityStageSubmoduleData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = gitg_ext_application_get_repository (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = gitg_repository_get_stage (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_;
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp2_);
	_data_->stage = _data_->_tmp8_;
	_data_->_tmp9_ = gitg_stage_status_submodule_get_flags (_data_->sub);
	_data_->_tmp10_ = _data_->_tmp9_;
	if ((_data_->_tmp10_ & GGIT_SUBMODULE_STATUS_WD_DELETED) != 0) {
		{
			_data_->_tmp11_ = _data_->stage;
			_data_->_tmp12_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->sub);
			_data_->_tmp13_ = _data_->_tmp12_;
			_data_->_tmp14_ = _data_->_tmp13_;
			_data_->_state_ = 1;
			gitg_stage_delete_path (_data_->_tmp11_, _data_->_tmp14_, gitg_commit_activity_stage_submodule_ready, _data_);
			return FALSE;
			_state_1:
			gitg_stage_delete_path_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error0_);
			_g_free0 (_data_->_tmp14_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp15_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->sub);
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_tmp17_ = _data_->_tmp16_;
			_data_->_tmp18_ = g_strdup_printf (_ ("Failed to stage the removal of submodule “%s”"), _data_->_tmp17_);
			_data_->_tmp19_ = _data_->_tmp18_;
			_g_free0 (_data_->_tmp17_);
			_data_->msg = _data_->_tmp19_;
			_data_->_tmp20_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_tmp22_ = _data_->_tmp21_;
			_data_->_tmp23_ = _data_->msg;
			_data_->_tmp24_ = _data_->e;
			_data_->_tmp25_ = _data_->_tmp24_->message;
			gitg_ext_application_show_infobar (_data_->_tmp22_, _data_->_tmp23_, _data_->_tmp25_, GTK_MESSAGE_ERROR);
			_g_object_unref0 (_data_->_tmp22_);
			_data_->result = FALSE;
			_g_free0 (_data_->msg);
			_g_error_free0 (_data_->e);
			_g_object_unref0 (_data_->stage);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stage);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	} else {
		{
			_data_->_tmp27_ = gitg_stage_status_submodule_get_submodule (_data_->sub);
			_data_->_tmp28_ = _data_->_tmp27_;
			_data_->_tmp29_ = ggit_submodule_open (_data_->_tmp28_, &_data_->_inner_error0_);
			_data_->_tmp26_ = _data_->_tmp29_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
			_data_->_tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp26_, GITG_TYPE_REPOSITORY) ? ((GitgRepository*) _data_->_tmp26_) : NULL);
			_g_object_unref0 (_data_->repo);
			_data_->repo = _data_->_tmp30_;
			_g_object_unref0 (_data_->_tmp26_);
		}
		goto __finally1;
		__catch1_g_error:
		{
			_data_->_vala1_e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp31_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->sub);
			_data_->_tmp32_ = _data_->_tmp31_;
			_data_->_tmp33_ = _data_->_tmp32_;
			_data_->_tmp34_ = g_strdup_printf (_ ("Failed to open the repository of submodule “%s” while trying to stage"), _data_->_tmp33_);
			_data_->_tmp35_ = _data_->_tmp34_;
			_g_free0 (_data_->_tmp33_);
			_data_->_vala1_msg = _data_->_tmp35_;
			_data_->_tmp36_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
			_data_->_tmp37_ = _data_->_tmp36_;
			_data_->_tmp38_ = _data_->_tmp37_;
			_data_->_tmp39_ = _data_->_vala1_msg;
			_data_->_tmp40_ = _data_->_vala1_e;
			_data_->_tmp41_ = _data_->_tmp40_->message;
			gitg_ext_application_show_infobar (_data_->_tmp38_, _data_->_tmp39_, _data_->_tmp41_, GTK_MESSAGE_ERROR);
			_g_object_unref0 (_data_->_tmp38_);
			_data_->result = FALSE;
			_g_free0 (_data_->_vala1_msg);
			_g_error_free0 (_data_->_vala1_e);
			_g_object_unref0 (_data_->repo);
			_g_object_unref0 (_data_->stage);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		__finally1:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->repo);
			_g_object_unref0 (_data_->stage);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp42_ = _g_object_ref0 ((GgitCommit*) _data_->commit);
		_data_->sub_commit = _data_->_tmp42_;
		_data_->_tmp43_ = _data_->sub_commit;
		if (_data_->_tmp43_ == NULL) {
			{
				_data_->_tmp45_ = _data_->repo;
				_data_->_tmp46_ = gitg_stage_status_submodule_get_submodule (_data_->sub);
				_data_->_tmp47_ = _data_->_tmp46_;
				_data_->_tmp48_ = ggit_submodule_get_workdir_id (_data_->_tmp47_);
				_data_->_tmp49_ = _data_->_tmp48_;
				_data_->_tmp50_ = gitg_repository_lookup (_data_->_tmp45_, GITG_TYPE_COMMIT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp49_, &_data_->_inner_error0_);
				_data_->_tmp51_ = (GitgCommit*) _data_->_tmp50_;
				__vala_GgitOId_free0 (_data_->_tmp49_);
				_data_->_tmp44_ = _data_->_tmp51_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					goto __catch2_g_error;
				}
				_data_->_tmp52_ = _data_->_tmp44_;
				_data_->_tmp44_ = NULL;
				_g_object_unref0 (_data_->sub_commit);
				_data_->sub_commit = (GgitCommit*) _data_->_tmp52_;
				_g_object_unref0 (_data_->_tmp44_);
			}
			goto __finally2;
			__catch2_g_error:
			{
				_data_->_vala2_e = _data_->_inner_error0_;
				_data_->_inner_error0_ = NULL;
				_data_->_tmp53_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->sub);
				_data_->_tmp54_ = _data_->_tmp53_;
				_data_->_tmp55_ = _data_->_tmp54_;
				_data_->_tmp56_ = g_strdup_printf (_ ("Failed to lookup the working directory commit of submodule “%s” while " \
"trying to stage"), _data_->_tmp55_);
				_data_->_tmp57_ = _data_->_tmp56_;
				_g_free0 (_data_->_tmp55_);
				_data_->_vala2_msg = _data_->_tmp57_;
				_data_->_tmp58_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
				_data_->_tmp59_ = _data_->_tmp58_;
				_data_->_tmp60_ = _data_->_tmp59_;
				_data_->_tmp61_ = _data_->_vala2_msg;
				_data_->_tmp62_ = _data_->_vala2_e;
				_data_->_tmp63_ = _data_->_tmp62_->message;
				gitg_ext_application_show_infobar (_data_->_tmp60_, _data_->_tmp61_, _data_->_tmp63_, GTK_MESSAGE_ERROR);
				_g_object_unref0 (_data_->_tmp60_);
				_data_->result = FALSE;
				_g_free0 (_data_->_vala2_msg);
				_g_error_free0 (_data_->_vala2_e);
				_g_object_unref0 (_data_->sub_commit);
				_g_object_unref0 (_data_->repo);
				_g_object_unref0 (_data_->stage);
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			__finally2:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->sub_commit);
				_g_object_unref0 (_data_->repo);
				_g_object_unref0 (_data_->stage);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		{
			_data_->_tmp64_ = _data_->stage;
			_data_->_tmp65_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->sub);
			_data_->_tmp66_ = _data_->_tmp65_;
			_data_->_tmp67_ = _data_->_tmp66_;
			_data_->_tmp68_ = _data_->sub_commit;
			_data_->_state_ = 2;
			gitg_stage_stage_commit (_data_->_tmp64_, _data_->_tmp67_, _data_->_tmp68_, gitg_commit_activity_stage_submodule_ready, _data_);
			return FALSE;
			_state_2:
			gitg_stage_stage_commit_finish (_data_->_tmp64_, _data_->_res_, &_data_->_inner_error0_);
			_g_free0 (_data_->_tmp67_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch3_g_error;
			}
		}
		goto __finally3;
		__catch3_g_error:
		{
			_data_->_vala3_e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp69_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->sub);
			_data_->_tmp70_ = _data_->_tmp69_;
			_data_->_tmp71_ = _data_->_tmp70_;
			_data_->_tmp72_ = g_strdup_printf (_ ("Failed to stage the submodule “%s”"), _data_->_tmp71_);
			_data_->_tmp73_ = _data_->_tmp72_;
			_g_free0 (_data_->_tmp71_);
			_data_->_vala3_msg = _data_->_tmp73_;
			_data_->_tmp74_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
			_data_->_tmp75_ = _data_->_tmp74_;
			_data_->_tmp76_ = _data_->_tmp75_;
			_data_->_tmp77_ = _data_->_vala3_msg;
			_data_->_tmp78_ = _data_->_vala3_e;
			_data_->_tmp79_ = _data_->_tmp78_->message;
			gitg_ext_application_show_infobar (_data_->_tmp76_, _data_->_tmp77_, _data_->_tmp79_, GTK_MESSAGE_ERROR);
			_g_object_unref0 (_data_->_tmp76_);
			_data_->result = FALSE;
			_g_free0 (_data_->_vala3_msg);
			_g_error_free0 (_data_->_vala3_e);
			_g_object_unref0 (_data_->sub_commit);
			_g_object_unref0 (_data_->repo);
			_g_object_unref0 (_data_->stage);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		__finally3:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->sub_commit);
			_g_object_unref0 (_data_->repo);
			_g_object_unref0 (_data_->stage);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->sub_commit);
		_g_object_unref0 (_data_->repo);
	}
	_data_->result = TRUE;
	_g_object_unref0 (_data_->stage);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gitg_commit_activity_stage_file_data_free (gpointer _data)
{
	GitgCommitActivityStageFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityStageFileData, _data_);
}

static void
gitg_commit_activity_stage_file (GitgCommitActivity* self,
                                 GitgStageStatusFile* file,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	GitgCommitActivityStageFileData* _data_;
	GitgCommitActivity* _tmp0_;
	GitgStageStatusFile* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityStageFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_stage_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (file);
	_g_object_unref0 (_data_->file);
	_data_->file = _tmp1_;
	gitg_commit_activity_stage_file_co (_data_);
}

static gboolean
gitg_commit_activity_stage_file_finish (GitgCommitActivity* self,
                                        GAsyncResult* _res_)
{
	gboolean result;
	GitgCommitActivityStageFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
gitg_commit_activity_stage_file_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	GitgCommitActivityStageFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_stage_file_co (_data_);
}

static gboolean
gitg_commit_activity_stage_file_co (GitgCommitActivityStageFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = gitg_ext_application_get_repository (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = gitg_repository_get_stage (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_;
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp2_);
	_data_->stage = _data_->_tmp8_;
	_data_->_tmp9_ = gitg_stage_status_file_get_flags (_data_->file);
	_data_->_tmp10_ = _data_->_tmp9_;
	if ((_data_->_tmp10_ & GGIT_STATUS_WORKING_TREE_DELETED) != 0) {
		{
			_data_->_tmp11_ = _data_->stage;
			_data_->_tmp12_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->file);
			_data_->_tmp13_ = _data_->_tmp12_;
			_data_->_tmp14_ = _data_->_tmp13_;
			_data_->_state_ = 1;
			gitg_stage_delete_path (_data_->_tmp11_, _data_->_tmp14_, gitg_commit_activity_stage_file_ready, _data_);
			return FALSE;
			_state_1:
			gitg_stage_delete_path_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error0_);
			_g_free0 (_data_->_tmp14_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp15_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->file);
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_tmp17_ = _data_->_tmp16_;
			_data_->_tmp18_ = g_strdup_printf (_ ("Failed to stage the removal of file “%s”"), _data_->_tmp17_);
			_data_->_tmp19_ = _data_->_tmp18_;
			_g_free0 (_data_->_tmp17_);
			_data_->msg = _data_->_tmp19_;
			_data_->_tmp20_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_tmp22_ = _data_->_tmp21_;
			_data_->_tmp23_ = _data_->msg;
			_data_->_tmp24_ = _data_->e;
			_data_->_tmp25_ = _data_->_tmp24_->message;
			gitg_ext_application_show_infobar (_data_->_tmp22_, _data_->_tmp23_, _data_->_tmp25_, GTK_MESSAGE_ERROR);
			_g_object_unref0 (_data_->_tmp22_);
			_data_->result = FALSE;
			_g_free0 (_data_->msg);
			_g_error_free0 (_data_->e);
			_g_object_unref0 (_data_->stage);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stage);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	} else {
		{
			_data_->_tmp26_ = _data_->stage;
			_data_->_tmp27_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->file);
			_data_->_tmp28_ = _data_->_tmp27_;
			_data_->_tmp29_ = _data_->_tmp28_;
			_data_->_state_ = 2;
			gitg_stage_stage_path (_data_->_tmp26_, _data_->_tmp29_, gitg_commit_activity_stage_file_ready, _data_);
			return FALSE;
			_state_2:
			gitg_stage_stage_path_finish (_data_->_tmp26_, _data_->_res_, &_data_->_inner_error0_);
			_g_free0 (_data_->_tmp29_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
		}
		goto __finally1;
		__catch1_g_error:
		{
			_data_->_vala1_e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp30_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->file);
			_data_->_tmp31_ = _data_->_tmp30_;
			_data_->_tmp32_ = _data_->_tmp31_;
			_data_->_tmp33_ = g_strdup_printf (_ ("Failed to stage the file “%s”"), _data_->_tmp32_);
			_data_->_tmp34_ = _data_->_tmp33_;
			_g_free0 (_data_->_tmp32_);
			_data_->_vala1_msg = _data_->_tmp34_;
			_data_->_tmp35_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
			_data_->_tmp36_ = _data_->_tmp35_;
			_data_->_tmp37_ = _data_->_tmp36_;
			_data_->_tmp38_ = _data_->_vala1_msg;
			_data_->_tmp39_ = _data_->_vala1_e;
			_data_->_tmp40_ = _data_->_tmp39_->message;
			gitg_ext_application_show_infobar (_data_->_tmp37_, _data_->_tmp38_, _data_->_tmp40_, GTK_MESSAGE_ERROR);
			_g_object_unref0 (_data_->_tmp37_);
			_data_->result = FALSE;
			_g_free0 (_data_->_vala1_msg);
			_g_error_free0 (_data_->_vala1_e);
			_g_object_unref0 (_data_->stage);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		__finally1:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stage);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->result = TRUE;
	_g_object_unref0 (_data_->stage);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gitg_commit_activity_stage_items_data_free (gpointer _data)
{
	GitgCommitActivityStageItemsData* _data_;
	_data_ = _data;
	_data_->items = (_vala_array_free (_data_->items, _data_->items_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityStageItemsData, _data_);
}

static void
gitg_commit_activity_stage_items (GitgCommitActivity* self,
                                  GitgStageStatusItem** items,
                                  gint items_length1,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	GitgCommitActivityStageItemsData* _data_;
	GitgCommitActivity* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityStageItemsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_stage_items_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->items = (_vala_array_free (_data_->items, _data_->items_length1, (GDestroyNotify) g_object_unref), NULL);
	_data_->items = items;
	_data_->items_length1 = items_length1;
	gitg_commit_activity_stage_items_co (_data_);
}

static void
gitg_commit_activity_stage_items_finish (GitgCommitActivity* self,
                                         GAsyncResult* _res_)
{
	GitgCommitActivityStageItemsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
gitg_commit_activity_stage_items_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	GitgCommitActivityStageItemsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_stage_items_co (_data_);
}

static gboolean
gitg_commit_activity_stage_items_co (GitgCommitActivityStageItemsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->item_collection_length1 = 0;
		_data_->_item_collection_size_ = 0;
		_data_->item_collection = _data_->items;
		_data_->item_collection_length1 = _data_->items_length1;
		for (_data_->item_it = 0; _data_->item_it < _data_->item_collection_length1; _data_->item_it = _data_->item_it + 1) {
			_data_->_tmp0_ = _g_object_ref0 (_data_->item_collection[_data_->item_it]);
			_data_->item = _data_->_tmp0_;
			{
				_data_->ok = TRUE;
				_data_->_tmp1_ = _data_->item;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp1_, GITG_TYPE_STAGE_STATUS_FILE)) {
					_data_->self->priv->d_ignore_external_changes = TRUE;
					_data_->_tmp2_ = _data_->item;
					_data_->_state_ = 1;
					gitg_commit_activity_stage_file (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp2_, GITG_TYPE_STAGE_STATUS_FILE, GitgStageStatusFile), gitg_commit_activity_stage_items_ready, _data_);
					return FALSE;
					_state_1:
					_data_->ok = gitg_commit_activity_stage_file_finish (_data_->self, _data_->_res_);
				} else {
					_data_->_tmp3_ = _data_->item;
					if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp3_, GITG_TYPE_STAGE_STATUS_SUBMODULE)) {
						_data_->self->priv->d_ignore_external_changes = TRUE;
						_data_->_tmp4_ = _data_->item;
						_data_->_state_ = 2;
						gitg_commit_activity_stage_submodule (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp4_, GITG_TYPE_STAGE_STATUS_SUBMODULE, GitgStageStatusSubmodule), NULL, gitg_commit_activity_stage_items_ready, _data_);
						return FALSE;
						_state_2:
						_data_->ok = gitg_commit_activity_stage_submodule_finish (_data_->self, _data_->_res_);
					} else {
						g_assert_not_reached ();
					}
				}
				if (!_data_->ok) {
					_g_object_unref0 (_data_->item);
					break;
				}
				_g_object_unref0 (_data_->item);
			}
		}
	}
	gitg_commit_activity_reload (_data_->self);
	_data_->items = (_vala_array_free (_data_->items, _data_->items_length1, (GDestroyNotify) g_object_unref), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gitg_commit_activity_show_ui (GitgCommitActivity* self,
                              GitgCommitActivityUiType type)
{
	GitgCommitPaned* _tmp0_;
	GitgCommitSubmoduleHistoryView* _tmp1_;
	GitgCommitSubmoduleHistoryView* _tmp2_;
	GitgCommitPaned* _tmp3_;
	GitgCommitSubmoduleDiffView* _tmp4_;
	GitgCommitSubmoduleDiffView* _tmp5_;
	GitgCommitPaned* _tmp6_;
	GitgDiffView* _tmp7_;
	GitgDiffView* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_submodule_history_view (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, type == GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_HISTORY);
	_tmp3_ = self->priv->d_main;
	_tmp4_ = gitg_commit_paned_get_submodule_diff_view (_tmp3_);
	_tmp5_ = _tmp4_;
	gtk_widget_set_visible ((GtkWidget*) _tmp5_, type == GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_DIFF);
	_tmp6_ = self->priv->d_main;
	_tmp7_ = gitg_commit_paned_get_diff_view (_tmp6_);
	_tmp8_ = _tmp7_;
	gtk_widget_set_visible ((GtkWidget*) _tmp8_, type == GITG_COMMIT_ACTIVITY_UI_TYPE_DIFF);
	if (type != GITG_COMMIT_ACTIVITY_UI_TYPE_DIFF) {
		GitgCommitPaned* _tmp9_;
		GitgDiffView* _tmp10_;
		GitgDiffView* _tmp11_;
		_tmp9_ = self->priv->d_main;
		_tmp10_ = gitg_commit_paned_get_diff_view (_tmp9_);
		_tmp11_ = _tmp10_;
		gitg_diff_view_set_diff (_tmp11_, NULL);
	}
	if (type != GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_DIFF) {
		GitgCommitSubmoduleDiffView* view = NULL;
		GitgCommitPaned* _tmp12_;
		GitgCommitSubmoduleDiffView* _tmp13_;
		GitgCommitSubmoduleDiffView* _tmp14_;
		GitgCommitSubmoduleDiffView* _tmp15_;
		GitgCommitSubmoduleDiffView* _tmp16_;
		GitgCommitSubmoduleInfo* _tmp17_;
		GitgCommitSubmoduleInfo* _tmp18_;
		GitgCommitSubmoduleDiffView* _tmp19_;
		GitgDiffView* _tmp20_;
		GitgDiffView* _tmp21_;
		GitgCommitSubmoduleDiffView* _tmp22_;
		GitgDiffView* _tmp23_;
		GitgDiffView* _tmp24_;
		_tmp12_ = self->priv->d_main;
		_tmp13_ = gitg_commit_paned_get_submodule_diff_view (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = _g_object_ref0 (_tmp14_);
		view = _tmp15_;
		_tmp16_ = view;
		_tmp17_ = gitg_commit_submodule_diff_view_get_info (_tmp16_);
		_tmp18_ = _tmp17_;
		gitg_commit_submodule_info_set_submodule (_tmp18_, NULL);
		_tmp19_ = view;
		_tmp20_ = gitg_commit_submodule_diff_view_get_diff_view_staged (_tmp19_);
		_tmp21_ = _tmp20_;
		gitg_diff_view_set_diff (_tmp21_, NULL);
		_tmp22_ = view;
		_tmp23_ = gitg_commit_submodule_diff_view_get_diff_view_unstaged (_tmp22_);
		_tmp24_ = _tmp23_;
		gitg_diff_view_set_diff (_tmp24_, NULL);
		_g_object_unref0 (view);
	}
	if (type != GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_HISTORY) {
		GitgCommitSubmoduleHistoryView* view = NULL;
		GitgCommitPaned* _tmp25_;
		GitgCommitSubmoduleHistoryView* _tmp26_;
		GitgCommitSubmoduleHistoryView* _tmp27_;
		GitgCommitSubmoduleHistoryView* _tmp28_;
		GitgCommitModel* model = NULL;
		GitgCommitSubmoduleHistoryView* _tmp29_;
		GitgCommitListView* _tmp30_;
		GitgCommitListView* _tmp31_;
		GtkTreeModel* _tmp32_;
		GtkTreeModel* _tmp33_;
		GitgCommitModel* _tmp34_;
		GitgCommitModel* _tmp35_;
		GitgCommitSubmoduleHistoryView* _tmp37_;
		GitgDiffView* _tmp38_;
		GitgDiffView* _tmp39_;
		_tmp25_ = self->priv->d_main;
		_tmp26_ = gitg_commit_paned_get_submodule_history_view (_tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = _g_object_ref0 (_tmp27_);
		view = _tmp28_;
		_tmp29_ = view;
		_tmp30_ = gitg_commit_submodule_history_view_get_commit_list_view (_tmp29_);
		_tmp31_ = _tmp30_;
		_tmp32_ = gtk_tree_view_get_model ((GtkTreeView*) _tmp31_);
		_tmp33_ = _tmp32_;
		_tmp34_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, GITG_TYPE_COMMIT_MODEL, GitgCommitModel));
		model = _tmp34_;
		_tmp35_ = model;
		if (_tmp35_ != NULL) {
			GitgCommitModel* _tmp36_;
			_tmp36_ = model;
			gitg_commit_model_set_repository (_tmp36_, NULL);
		}
		_tmp37_ = view;
		_tmp38_ = gitg_commit_submodule_history_view_get_diff_view (_tmp37_);
		_tmp39_ = _tmp38_;
		gitg_diff_view_set_diff (_tmp39_, NULL);
		_g_object_unref0 (self->priv->d_current_submodule);
		self->priv->d_current_submodule = NULL;
		_g_object_unref0 (self->priv->d_current_submodule_repository);
		self->priv->d_current_submodule_repository = NULL;
		_g_object_unref0 (model);
		_g_object_unref0 (view);
	}
}

static GitgStageStatusItem**
_vala_array_dup4 (GitgStageStatusItem** self,
                  gssize length)
{
	if (length >= 0) {
		GitgStageStatusItem** result;
		gssize i;
		result = g_new0 (GitgStageStatusItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgStageStatusItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
__lambda46_ (GitgCommitActivity* self,
             GObject* obj,
             GAsyncResult* res)
{
	g_return_if_fail (res != NULL);
	gitg_commit_activity_stage_items_finish (self, res);
}

static void
___lambda46__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda46_ ((GitgCommitActivity*) self, source_object, res);
	g_object_unref (self);
}

static void
gitg_commit_activity_on_unstaged_activated (GitgCommitActivity* self,
                                            GitgStageStatusItem** items,
                                            gint items_length1)
{
	GitgStageStatusItem** _tmp0_;
	gint _tmp0__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = (items != NULL) ? _vala_array_dup4 (items, items_length1) : items;
	_tmp0__length1 = items_length1;
	gitg_commit_activity_stage_items (self, _tmp0_, (gint) _tmp0__length1, ___lambda46__gasync_ready_callback, g_object_ref (self));
}

static void
gitg_commit_activity_show_submodule_diff (GitgCommitActivity* self,
                                          GitgStageStatusSubmodule* sub)
{
	GitgCommitSubmoduleDiffView* view = NULL;
	GitgCommitPaned* _tmp0_;
	GitgCommitSubmoduleDiffView* _tmp1_;
	GitgCommitSubmoduleDiffView* _tmp2_;
	GitgCommitSubmoduleDiffView* _tmp3_;
	GitgCommitSubmoduleDiffView* _tmp4_;
	GitgCommitSubmoduleInfo* _tmp5_;
	GitgCommitSubmoduleInfo* _tmp6_;
	GgitSubmodule* _tmp7_;
	GgitSubmodule* _tmp8_;
	GitgRepository* repo = NULL;
	GitgRepository* _tmp20_;
	GitgCommitSubmoduleDiffView* _tmp21_;
	GitgDiffView* _tmp22_;
	GitgDiffView* _tmp23_;
	GitgRepository* _tmp24_;
	GitgCommitSubmoduleDiffView* _tmp25_;
	GitgDiffView* _tmp26_;
	GitgDiffView* _tmp27_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sub != NULL);
	gitg_commit_activity_show_ui (self, GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_DIFF);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_submodule_diff_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	view = _tmp3_;
	_tmp4_ = view;
	_tmp5_ = gitg_commit_submodule_diff_view_get_info (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = gitg_stage_status_submodule_get_submodule (sub);
	_tmp8_ = _tmp7_;
	gitg_commit_submodule_info_set_submodule (_tmp6_, _tmp8_);
	{
		GgitRepository* _tmp9_ = NULL;
		GgitSubmodule* _tmp10_;
		GgitSubmodule* _tmp11_;
		GgitRepository* _tmp12_;
		GitgRepository* _tmp13_;
		_tmp10_ = gitg_stage_status_submodule_get_submodule (sub);
		_tmp11_ = _tmp10_;
		_tmp12_ = ggit_submodule_open (_tmp11_, &_inner_error0_);
		_tmp9_ = _tmp12_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GITG_TYPE_REPOSITORY) ? ((GitgRepository*) _tmp9_) : NULL);
		_g_object_unref0 (repo);
		repo = _tmp13_;
		_g_object_unref0 (_tmp9_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GitgCommitSubmoduleDiffView* _tmp14_;
		GitgDiffView* _tmp15_;
		GitgDiffView* _tmp16_;
		GitgCommitSubmoduleDiffView* _tmp17_;
		GitgDiffView* _tmp18_;
		GitgDiffView* _tmp19_;
		g_clear_error (&_inner_error0_);
		_tmp14_ = view;
		_tmp15_ = gitg_commit_submodule_diff_view_get_diff_view_staged (_tmp14_);
		_tmp16_ = _tmp15_;
		gitg_diff_view_set_diff (_tmp16_, NULL);
		_tmp17_ = view;
		_tmp18_ = gitg_commit_submodule_diff_view_get_diff_view_unstaged (_tmp17_);
		_tmp19_ = _tmp18_;
		gitg_diff_view_set_diff (_tmp19_, NULL);
		_g_object_unref0 (repo);
		_g_object_unref0 (view);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (repo);
		_g_object_unref0 (view);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp20_ = repo;
	_tmp21_ = view;
	_tmp22_ = gitg_commit_submodule_diff_view_get_diff_view_staged (_tmp21_);
	_tmp23_ = _tmp22_;
	gitg_commit_activity_show_staged_diff_intern (self, _tmp20_, _tmp23_, NULL, (gint) 0, FALSE);
	_tmp24_ = repo;
	_tmp25_ = view;
	_tmp26_ = gitg_commit_submodule_diff_view_get_diff_view_unstaged (_tmp25_);
	_tmp27_ = _tmp26_;
	gitg_commit_activity_show_unstaged_diff_intern (self, _tmp24_, _tmp27_, NULL, (gint) 0, FALSE);
	_g_object_unref0 (repo);
	_g_object_unref0 (view);
}

static void
gitg_commit_activity_submodule_history_selection_changed (GitgCommitActivity* self,
                                                          GitgCommit* commit)
{
	GitgCommitSubmoduleHistoryView* view = NULL;
	GitgCommitPaned* _tmp0_;
	GitgCommitSubmoduleHistoryView* _tmp1_;
	GitgCommitSubmoduleHistoryView* _tmp2_;
	GitgCommitSubmoduleHistoryView* _tmp3_;
	GitgRepository* _tmp7_;
	GitgRepository* repo = NULL;
	GitgRepository* _tmp8_;
	GitgRepository* _tmp9_;
	GgitTree* commit_tree = NULL;
	GgitTree* _tmp10_;
	GgitOId* head = NULL;
	GitgStageStatusSubmodule* _tmp11_;
	GgitSubmodule* _tmp12_;
	GgitSubmodule* _tmp13_;
	GgitOId* _tmp14_;
	GgitTree* head_tree = NULL;
	GgitOId* _tmp15_;
	GgitDiff* diff = NULL;
	GitgCommitSubmoduleHistoryView* _tmp40_;
	GitgDiffView* _tmp41_;
	GitgDiffView* _tmp42_;
	GitgCommitSubmoduleHistoryView* _tmp43_;
	GitgDiffView* _tmp44_;
	GitgDiffView* _tmp45_;
	GgitDiff* _tmp46_;
	GitgCommitSubmoduleHistoryView* _tmp47_;
	GitgDiffView* _tmp48_;
	GitgDiffView* _tmp49_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_submodule_history_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	view = _tmp3_;
	if (commit == NULL) {
		GitgCommitSubmoduleHistoryView* _tmp4_;
		GitgDiffView* _tmp5_;
		GitgDiffView* _tmp6_;
		_tmp4_ = view;
		_tmp5_ = gitg_commit_submodule_history_view_get_diff_view (_tmp4_);
		_tmp6_ = _tmp5_;
		gitg_diff_view_set_diff (_tmp6_, NULL);
		_g_object_unref0 (view);
		return;
	}
	_tmp7_ = self->priv->d_current_submodule_repository;
	if (_tmp7_ == NULL) {
		_g_object_unref0 (view);
		return;
	}
	_tmp8_ = self->priv->d_current_submodule_repository;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	repo = _tmp9_;
	_tmp10_ = ggit_commit_get_tree ((GgitCommit*) commit);
	commit_tree = _tmp10_;
	_tmp11_ = self->priv->d_current_submodule;
	_tmp12_ = gitg_stage_status_submodule_get_submodule (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = ggit_submodule_get_head_id (_tmp13_);
	head = _tmp14_;
	head_tree = NULL;
	_tmp15_ = head;
	if (_tmp15_ != NULL) {
		GgitCommit* head_commit = NULL;
		GgitCommit* _tmp24_;
		GgitTree* _tmp25_;
		{
			GitgCommit* _tmp16_ = NULL;
			GitgRepository* _tmp17_;
			GgitOId* _tmp18_;
			gpointer _tmp19_;
			GitgCommit* _tmp20_;
			_tmp17_ = repo;
			_tmp18_ = head;
			_tmp19_ = gitg_repository_lookup (_tmp17_, GITG_TYPE_COMMIT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp18_, &_inner_error0_);
			_tmp16_ = (GitgCommit*) _tmp19_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp20_ = _tmp16_;
			_tmp16_ = NULL;
			_g_object_unref0 (head_commit);
			head_commit = (GgitCommit*) _tmp20_;
			_g_object_unref0 (_tmp16_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			FILE* _tmp21_;
			GError* _tmp22_;
			const gchar* _tmp23_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp21_ = stderr;
			_tmp22_ = e;
			_tmp23_ = _tmp22_->message;
			fprintf (_tmp21_, "Failed to get head commit: %s\n", _tmp23_);
			_g_error_free0 (e);
			_g_object_unref0 (head_commit);
			_g_object_unref0 (head_tree);
			__vala_GgitOId_free0 (head);
			_g_object_unref0 (commit_tree);
			_g_object_unref0 (repo);
			_g_object_unref0 (view);
			return;
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (head_commit);
			_g_object_unref0 (head_tree);
			__vala_GgitOId_free0 (head);
			_g_object_unref0 (commit_tree);
			_g_object_unref0 (repo);
			_g_object_unref0 (view);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp24_ = head_commit;
		_tmp25_ = ggit_commit_get_tree (_tmp24_);
		_g_object_unref0 (head_tree);
		head_tree = _tmp25_;
		_g_object_unref0 (head_commit);
	}
	{
		GgitDiff* _tmp26_ = NULL;
		GitgRepository* _tmp27_;
		GgitTree* _tmp28_;
		GgitTree* _tmp29_;
		GitgCommitSubmoduleHistoryView* _tmp30_;
		GitgDiffView* _tmp31_;
		GitgDiffView* _tmp32_;
		GgitDiffOptions* _tmp33_;
		GgitDiffOptions* _tmp34_;
		GgitDiff* _tmp35_;
		GgitDiff* _tmp36_;
		_tmp27_ = repo;
		_tmp28_ = head_tree;
		_tmp29_ = commit_tree;
		_tmp30_ = view;
		_tmp31_ = gitg_commit_submodule_history_view_get_diff_view (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = gitg_diff_view_get_options (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp35_ = ggit_diff_new_tree_to_tree ((GgitRepository*) _tmp27_, _tmp28_, _tmp29_, _tmp34_, &_inner_error0_);
		_tmp26_ = _tmp35_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
		_tmp36_ = _tmp26_;
		_tmp26_ = NULL;
		_g_object_unref0 (diff);
		diff = _tmp36_;
		_g_object_unref0 (_tmp26_);
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		FILE* _tmp37_;
		GError* _tmp38_;
		const gchar* _tmp39_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp37_ = stderr;
		_tmp38_ = e;
		_tmp39_ = _tmp38_->message;
		fprintf (_tmp37_, "Failed to get diff: %s\n", _tmp39_);
		_g_error_free0 (e);
		_g_object_unref0 (diff);
		_g_object_unref0 (head_tree);
		__vala_GgitOId_free0 (head);
		_g_object_unref0 (commit_tree);
		_g_object_unref0 (repo);
		_g_object_unref0 (view);
		return;
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (diff);
		_g_object_unref0 (head_tree);
		__vala_GgitOId_free0 (head);
		_g_object_unref0 (commit_tree);
		_g_object_unref0 (repo);
		_g_object_unref0 (view);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp40_ = view;
	_tmp41_ = gitg_commit_submodule_history_view_get_diff_view (_tmp40_);
	_tmp42_ = _tmp41_;
	gitg_diff_view_set_new_is_workdir (_tmp42_, FALSE);
	_tmp43_ = view;
	_tmp44_ = gitg_commit_submodule_history_view_get_diff_view (_tmp43_);
	_tmp45_ = _tmp44_;
	_tmp46_ = diff;
	gitg_diff_view_set_diff (_tmp45_, _tmp46_);
	_tmp47_ = view;
	_tmp48_ = gitg_commit_submodule_history_view_get_diff_view (_tmp47_);
	_tmp49_ = _tmp48_;
	gitg_diff_view_set_commit (_tmp49_, commit);
	_g_object_unref0 (diff);
	_g_object_unref0 (head_tree);
	__vala_GgitOId_free0 (head);
	_g_object_unref0 (commit_tree);
	_g_object_unref0 (repo);
	_g_object_unref0 (view);
}

static gpointer
_ggit_submodule_ref0 (gpointer self)
{
	return self ? ggit_submodule_ref (self) : NULL;
}

static GgitOId*
_vala_GgitOId_copy (GgitOId* self)
{
	return g_boxed_copy (ggit_oid_get_type (), self);
}

static gpointer
__vala_GgitOId_copy0 (gpointer self)
{
	return self ? _vala_GgitOId_copy (self) : NULL;
}

static void
___lambda55_ (GitgCommitActivity* self,
              GitgCommit* commit)
{
	g_return_if_fail (commit != NULL);
	gitg_commit_activity_unstage_submodule_at (self, commit);
}

static void
____lambda55__gitg_commit_activity_stage_unstage_submodule_commit_callback (GitgCommit* commit,
                                                                            gpointer self)
{
	___lambda55_ ((GitgCommitActivity*) self, commit);
}

static void
___lambda58_ (GitgCommitActivity* self,
              GitgCommit* commit)
{
	g_return_if_fail (commit != NULL);
	gitg_commit_activity_stage_submodule_at (self, commit);
}

static void
____lambda58__gitg_commit_activity_stage_unstage_submodule_commit_callback (GitgCommit* commit,
                                                                            gpointer self)
{
	___lambda58_ ((GitgCommitActivity*) self, commit);
}

static void
gitg_commit_activity_show_submodule_history (GitgCommitActivity* self,
                                             GitgStageStatusSubmodule* sub,
                                             GitgCommitActivityIndexType type)
{
	GitgRepository* repo = NULL;
	GgitSubmodule* submodule = NULL;
	GgitSubmodule* _tmp0_;
	GgitSubmodule* _tmp1_;
	GgitSubmodule* _tmp2_;
	GitgStageStatusSubmodule* _tmp10_;
	GitgRepository* _tmp11_;
	GitgRepository* _tmp12_;
	GitgCommitSubmoduleHistoryView* view = NULL;
	GitgCommitPaned* _tmp13_;
	GitgCommitSubmoduleHistoryView* _tmp14_;
	GitgCommitSubmoduleHistoryView* _tmp15_;
	GitgCommitSubmoduleHistoryView* _tmp16_;
	GitgCommitModel* model = NULL;
	GitgCommitSubmoduleHistoryView* _tmp17_;
	GitgCommitListView* _tmp18_;
	GitgCommitListView* _tmp19_;
	GtkTreeModel* _tmp20_;
	GtkTreeModel* _tmp21_;
	GitgCommitModel* _tmp22_;
	GitgCommitModel* _tmp23_;
	GitgCommitModel* _tmp64_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sub != NULL);
	gitg_commit_activity_show_ui (self, GITG_COMMIT_ACTIVITY_UI_TYPE_SUBMODULE_HISTORY);
	_g_object_unref0 (self->priv->d_current_submodule);
	self->priv->d_current_submodule = NULL;
	_g_object_unref0 (self->priv->d_current_submodule_repository);
	self->priv->d_current_submodule_repository = NULL;
	_tmp0_ = gitg_stage_status_submodule_get_submodule (sub);
	_tmp1_ = _tmp0_;
	_tmp2_ = _ggit_submodule_ref0 (_tmp1_);
	submodule = _tmp2_;
	{
		GgitRepository* _tmp3_ = NULL;
		GgitSubmodule* _tmp4_;
		GgitRepository* _tmp5_;
		GitgRepository* _tmp6_;
		_tmp4_ = submodule;
		_tmp5_ = ggit_submodule_open (_tmp4_, &_inner_error0_);
		_tmp3_ = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GITG_TYPE_REPOSITORY) ? ((GitgRepository*) _tmp3_) : NULL);
		_g_object_unref0 (repo);
		repo = _tmp6_;
		_g_object_unref0 (_tmp3_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		FILE* _tmp7_;
		GError* _tmp8_;
		const gchar* _tmp9_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = stderr;
		_tmp8_ = e;
		_tmp9_ = _tmp8_->message;
		fprintf (_tmp7_, "Failed to open submodule repository: %s\n", _tmp9_);
		_g_error_free0 (e);
		_ggit_submodule_unref0 (submodule);
		_g_object_unref0 (repo);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_ggit_submodule_unref0 (submodule);
		_g_object_unref0 (repo);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp10_ = _g_object_ref0 (sub);
	_g_object_unref0 (self->priv->d_current_submodule);
	self->priv->d_current_submodule = _tmp10_;
	_tmp11_ = repo;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	_g_object_unref0 (self->priv->d_current_submodule_repository);
	self->priv->d_current_submodule_repository = _tmp12_;
	_tmp13_ = self->priv->d_main;
	_tmp14_ = gitg_commit_paned_get_submodule_history_view (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _g_object_ref0 (_tmp15_);
	view = _tmp16_;
	_tmp17_ = view;
	_tmp18_ = gitg_commit_submodule_history_view_get_commit_list_view (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = gtk_tree_view_get_model ((GtkTreeView*) _tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GITG_TYPE_COMMIT_MODEL, GitgCommitModel));
	model = _tmp22_;
	_tmp23_ = model;
	if (_tmp23_ == NULL) {
		GitgRepository* _tmp24_;
		GitgCommitModel* _tmp25_;
		GitgCommitSubmoduleHistoryView* _tmp26_;
		GitgCommitListView* _tmp27_;
		GitgCommitListView* _tmp28_;
		GitgCommitModel* _tmp29_;
		_tmp24_ = repo;
		_tmp25_ = gitg_commit_model_new (_tmp24_);
		_g_object_unref0 (model);
		model = _tmp25_;
		_tmp26_ = view;
		_tmp27_ = gitg_commit_submodule_history_view_get_commit_list_view (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp29_ = model;
		gtk_tree_view_set_model ((GtkTreeView*) _tmp28_, (GtkTreeModel*) _tmp29_);
	} else {
		GitgCommitModel* _tmp30_;
		GitgRepository* _tmp31_;
		_tmp30_ = model;
		_tmp31_ = repo;
		gitg_commit_model_set_repository (_tmp30_, _tmp31_);
	}
	if (type == GITG_COMMIT_ACTIVITY_INDEX_TYPE_STAGED) {
		GitgCommitModel* _tmp32_;
		GgitSubmodule* _tmp33_;
		GgitOId* _tmp34_;
		GgitOId** _tmp35_;
		GgitOId** _tmp36_;
		gint _tmp36__length1;
		GgitOId* head_id = NULL;
		GgitSubmodule* _tmp37_;
		GgitOId* _tmp38_;
		GgitOId* _tmp39_;
		_tmp32_ = model;
		_tmp33_ = submodule;
		_tmp34_ = ggit_submodule_get_index_id (_tmp33_);
		_tmp35_ = g_new0 (GgitOId*, 1 + 1);
		_tmp35_[0] = _tmp34_;
		_tmp36_ = _tmp35_;
		_tmp36__length1 = 1;
		gitg_commit_model_set_include (_tmp32_, _tmp36_, (gint) 1);
		_tmp36_ = (_vala_array_free (_tmp36_, _tmp36__length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
		_tmp37_ = submodule;
		_tmp38_ = ggit_submodule_get_head_id (_tmp37_);
		head_id = _tmp38_;
		_tmp39_ = head_id;
		if (_tmp39_ != NULL) {
			GitgCommitModel* _tmp40_;
			GgitOId* _tmp41_;
			GgitOId* _tmp42_;
			GgitOId** _tmp43_;
			GgitOId** _tmp44_;
			gint _tmp44__length1;
			_tmp40_ = model;
			_tmp41_ = head_id;
			_tmp42_ = __vala_GgitOId_copy0 (_tmp41_);
			_tmp43_ = g_new0 (GgitOId*, 1 + 1);
			_tmp43_[0] = _tmp42_;
			_tmp44_ = _tmp43_;
			_tmp44__length1 = 1;
			gitg_commit_model_set_exclude (_tmp40_, _tmp44_, (gint) 1);
			_tmp44_ = (_vala_array_free (_tmp44_, _tmp44__length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
		} else {
			GitgCommitModel* _tmp45_;
			GgitOId** _tmp46_;
			GgitOId** _tmp47_;
			gint _tmp47__length1;
			_tmp45_ = model;
			_tmp46_ = g_new0 (GgitOId*, 0 + 1);
			_tmp47_ = _tmp46_;
			_tmp47__length1 = 0;
			gitg_commit_model_set_exclude (_tmp45_, _tmp47_, (gint) 0);
			_tmp47_ = (_vala_array_free (_tmp47_, _tmp47__length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
		}
		(self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify == NULL) ? NULL : (self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify (self->priv->d_stage_unstage_submodule_commit_callback_target), NULL);
		self->priv->d_stage_unstage_submodule_commit_callback = NULL;
		self->priv->d_stage_unstage_submodule_commit_callback_target = NULL;
		self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify = NULL;
		self->priv->d_stage_unstage_submodule_commit_callback = ____lambda55__gitg_commit_activity_stage_unstage_submodule_commit_callback;
		self->priv->d_stage_unstage_submodule_commit_callback_target = g_object_ref (self);
		self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify = g_object_unref;
		__vala_GgitOId_free0 (head_id);
	} else {
		GgitOId* index_id = NULL;
		GgitSubmodule* _tmp48_;
		GgitOId* _tmp49_;
		GitgCommitModel* _tmp50_;
		GgitSubmodule* _tmp51_;
		GgitOId* _tmp52_;
		GgitOId** _tmp53_;
		GgitOId** _tmp54_;
		gint _tmp54__length1;
		GgitOId* _tmp55_;
		_tmp48_ = submodule;
		_tmp49_ = ggit_submodule_get_index_id (_tmp48_);
		index_id = _tmp49_;
		_tmp50_ = model;
		_tmp51_ = submodule;
		_tmp52_ = ggit_submodule_get_workdir_id (_tmp51_);
		_tmp53_ = g_new0 (GgitOId*, 1 + 1);
		_tmp53_[0] = _tmp52_;
		_tmp54_ = _tmp53_;
		_tmp54__length1 = 1;
		gitg_commit_model_set_include (_tmp50_, _tmp54_, (gint) 1);
		_tmp54_ = (_vala_array_free (_tmp54_, _tmp54__length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
		_tmp55_ = index_id;
		if (_tmp55_ != NULL) {
			GitgCommitModel* _tmp56_;
			GgitOId* _tmp57_;
			GgitOId* _tmp58_;
			GgitOId** _tmp59_;
			GgitOId** _tmp60_;
			gint _tmp60__length1;
			_tmp56_ = model;
			_tmp57_ = index_id;
			_tmp58_ = __vala_GgitOId_copy0 (_tmp57_);
			_tmp59_ = g_new0 (GgitOId*, 1 + 1);
			_tmp59_[0] = _tmp58_;
			_tmp60_ = _tmp59_;
			_tmp60__length1 = 1;
			gitg_commit_model_set_exclude (_tmp56_, _tmp60_, (gint) 1);
			_tmp60_ = (_vala_array_free (_tmp60_, _tmp60__length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
		} else {
			GitgCommitModel* _tmp61_;
			GgitOId** _tmp62_;
			GgitOId** _tmp63_;
			gint _tmp63__length1;
			_tmp61_ = model;
			_tmp62_ = g_new0 (GgitOId*, 0 + 1);
			_tmp63_ = _tmp62_;
			_tmp63__length1 = 0;
			gitg_commit_model_set_exclude (_tmp61_, _tmp63_, (gint) 0);
			_tmp63_ = (_vala_array_free (_tmp63_, _tmp63__length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
		}
		(self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify == NULL) ? NULL : (self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify (self->priv->d_stage_unstage_submodule_commit_callback_target), NULL);
		self->priv->d_stage_unstage_submodule_commit_callback = NULL;
		self->priv->d_stage_unstage_submodule_commit_callback_target = NULL;
		self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify = NULL;
		self->priv->d_stage_unstage_submodule_commit_callback = ____lambda58__gitg_commit_activity_stage_unstage_submodule_commit_callback;
		self->priv->d_stage_unstage_submodule_commit_callback_target = g_object_ref (self);
		self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify = g_object_unref;
		__vala_GgitOId_free0 (index_id);
	}
	self->priv->d_submodule_history_select_first = TRUE;
	_tmp64_ = model;
	gitg_commit_model_reload (_tmp64_);
	_g_object_unref0 (model);
	_g_object_unref0 (view);
	_ggit_submodule_unref0 (submodule);
	_g_object_unref0 (repo);
}

static Block19Data*
block19_data_ref (Block19Data* _data19_)
{
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}

static void
block19_data_unref (void * _userdata_)
{
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data19_->self;
		_g_object_unref0 (_data19_->repository);
		_g_object_unref0 (_data19_->view);
		_data19_->items = (_vala_array_free (_data19_->items, _data19_->items_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block19Data, _data19_);
	}
}

static void
__lambda62_ (Block19Data* _data19_)
{
	GitgCommitActivity* self;
	self = _data19_->self;
	gitg_commit_activity_show_staged_diff_intern (self, _data19_->repository, _data19_->view, _data19_->items, (gint) _data19_->items_length1, _data19_->patchable);
}

static void
___lambda62__gitg_commit_activity_update_diff_callback (gpointer self)
{
	__lambda62_ (self);
}

static void
gitg_commit_activity_set_staged_diff_update_callback (GitgCommitActivity* self,
                                                      GitgRepository* repository,
                                                      GitgDiffView* view,
                                                      GitgStageStatusItem** items,
                                                      gint items_length1,
                                                      gboolean patchable)
{
	Block19Data* _data19_;
	GitgRepository* _tmp0_;
	GitgDiffView* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (repository != NULL);
	g_return_if_fail (view != NULL);
	_data19_ = g_slice_new0 (Block19Data);
	_data19_->_ref_count_ = 1;
	_data19_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (repository);
	_g_object_unref0 (_data19_->repository);
	_data19_->repository = _tmp0_;
	_tmp1_ = _g_object_ref0 (view);
	_g_object_unref0 (_data19_->view);
	_data19_->view = _tmp1_;
	_data19_->items = (_vala_array_free (_data19_->items, _data19_->items_length1, (GDestroyNotify) g_object_unref), NULL);
	_data19_->items = items;
	_data19_->items_length1 = items_length1;
	_data19_->patchable = patchable;
	(self->priv->d_update_diff_callback_target_destroy_notify == NULL) ? NULL : (self->priv->d_update_diff_callback_target_destroy_notify (self->priv->d_update_diff_callback_target), NULL);
	self->priv->d_update_diff_callback = NULL;
	self->priv->d_update_diff_callback_target = NULL;
	self->priv->d_update_diff_callback_target_destroy_notify = NULL;
	self->priv->d_update_diff_callback = ___lambda62__gitg_commit_activity_update_diff_callback;
	self->priv->d_update_diff_callback_target = block19_data_ref (_data19_);
	self->priv->d_update_diff_callback_target_destroy_notify = block19_data_unref;
	block19_data_unref (_data19_);
	_data19_ = NULL;
}

static Block20Data*
block20_data_ref (Block20Data* _data20_)
{
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}

static void
block20_data_unref (void * _userdata_)
{
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data20_->self;
		_g_object_unref0 (_data20_->stage);
		_g_object_unref0 (_data20_->view);
		_g_object_unref0 (self);
		g_slice_free (Block20Data, _data20_);
	}
}

static void
__lambda61_ (Block20Data* _data20_,
             GObject* obj,
             GAsyncResult* res)
{
	GitgCommitActivity* self;
	GError* _inner_error0_ = NULL;
	self = _data20_->self;
	g_return_if_fail (res != NULL);
	{
		GgitDiff* d = NULL;
		GgitDiff* _tmp0_;
		GitgCommitPaned* _tmp1_;
		GtkButton* _tmp2_;
		GtkButton* _tmp3_;
		GitgCommitPaned* _tmp4_;
		GtkButton* _tmp5_;
		GtkButton* _tmp6_;
		GitgCommitPaned* _tmp7_;
		GtkButton* _tmp8_;
		GtkButton* _tmp9_;
		_tmp0_ = gitg_stage_diff_index_all_finish (_data20_->stage, res, &_inner_error0_);
		d = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		gitg_diff_view_set_unstaged (_data20_->view, FALSE);
		gitg_diff_view_set_staged (_data20_->view, _data20_->patchable);
		_tmp1_ = self->priv->d_main;
		_tmp2_ = gitg_commit_paned_get_button_stage (_tmp1_);
		_tmp3_ = _tmp2_;
		gtk_button_set_label (_tmp3_, _ ("_Unstage selection"));
		_tmp4_ = self->priv->d_main;
		_tmp5_ = gitg_commit_paned_get_button_stage (_tmp4_);
		_tmp6_ = _tmp5_;
		gtk_widget_set_visible ((GtkWidget*) _tmp6_, _data20_->patchable);
		_tmp7_ = self->priv->d_main;
		_tmp8_ = gitg_commit_paned_get_button_discard (_tmp7_);
		_tmp9_ = _tmp8_;
		gtk_widget_set_visible ((GtkWidget*) _tmp9_, FALSE);
		gitg_diff_view_set_new_is_workdir (_data20_->view, FALSE);
		gitg_diff_view_set_diff (_data20_->view, d);
		_g_object_unref0 (d);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		gitg_diff_view_set_diff (_data20_->view, NULL);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda61__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda61_ (self, source_object, res);
	block20_data_unref (self);
}

static GitgStageStatusItem**
_vala_array_dup5 (GitgStageStatusItem** self,
                  gssize length)
{
	if (length >= 0) {
		GitgStageStatusItem** result;
		gssize i;
		result = g_new0 (GitgStageStatusItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgStageStatusItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
gitg_commit_activity_show_staged_diff_intern (GitgCommitActivity* self,
                                              GitgRepository* repository,
                                              GitgDiffView* view,
                                              GitgStageStatusItem** items,
                                              gint items_length1,
                                              gboolean patchable)
{
	Block20Data* _data20_;
	GitgDiffView* _tmp0_;
	GitgStage* _tmp1_;
	GitgStage* _tmp2_;
	GgitDiffOptions* _tmp3_;
	GgitDiffOptions* _tmp4_;
	GitgStageStatusItem** _tmp5_;
	gint _tmp5__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (repository != NULL);
	g_return_if_fail (view != NULL);
	_data20_ = g_slice_new0 (Block20Data);
	_data20_->_ref_count_ = 1;
	_data20_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (view);
	_g_object_unref0 (_data20_->view);
	_data20_->view = _tmp0_;
	_data20_->patchable = patchable;
	_tmp1_ = gitg_repository_get_stage (repository);
	_tmp2_ = _tmp1_;
	_data20_->stage = _tmp2_;
	_tmp3_ = gitg_diff_view_get_options (_data20_->view);
	_tmp4_ = _tmp3_;
	gitg_stage_diff_index_all (_data20_->stage, items, (gint) items_length1, _tmp4_, ___lambda61__gasync_ready_callback, block20_data_ref (_data20_));
	_tmp5_ = (items != NULL) ? _vala_array_dup5 (items, items_length1) : items;
	_tmp5__length1 = items_length1;
	gitg_commit_activity_set_staged_diff_update_callback (self, repository, _data20_->view, _tmp5_, (gint) _tmp5__length1, _data20_->patchable);
	block20_data_unref (_data20_);
	_data20_ = NULL;
}

static void
gitg_commit_activity_show_staged_diff (GitgCommitActivity* self,
                                       GitgStageStatusItem** items,
                                       gint items_length1)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (items_length1 == 1) {
		GitgStageStatusItem* _tmp1_;
		_tmp1_ = items[0];
		_tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GITG_TYPE_STAGE_STATUS_SUBMODULE);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GitgStageStatusItem* _tmp2_;
		_tmp2_ = items[0];
		gitg_commit_activity_show_submodule_history (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GITG_TYPE_STAGE_STATUS_SUBMODULE, GitgStageStatusSubmodule), GITG_COMMIT_ACTIVITY_INDEX_TYPE_STAGED);
	} else {
		GitgExtApplication* _tmp3_;
		GitgExtApplication* _tmp4_;
		GitgExtApplication* _tmp5_;
		GitgRepository* _tmp6_;
		GitgRepository* _tmp7_;
		GitgRepository* _tmp8_;
		GitgCommitPaned* _tmp9_;
		GitgDiffView* _tmp10_;
		GitgDiffView* _tmp11_;
		gitg_commit_activity_show_ui (self, GITG_COMMIT_ACTIVITY_UI_TYPE_DIFF);
		_tmp3_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = gitg_ext_application_get_repository (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = self->priv->d_main;
		_tmp10_ = gitg_commit_paned_get_diff_view (_tmp9_);
		_tmp11_ = _tmp10_;
		gitg_commit_activity_show_staged_diff_intern (self, _tmp8_, _tmp11_, items, (gint) items_length1, TRUE);
		_g_object_unref0 (_tmp8_);
		_g_object_unref0 (_tmp5_);
	}
}

static void
gitg_commit_activity_unstage_item_data_free (gpointer _data)
{
	GitgCommitActivityUnstageItemData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->item);
	_g_free0 (_data_->removal_msg);
	_g_free0 (_data_->unstage_msg);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityUnstageItemData, _data_);
}

static void
gitg_commit_activity_unstage_item (GitgCommitActivity* self,
                                   GitgStageStatusItem* item,
                                   gboolean isnew,
                                   const gchar* removal_msg,
                                   const gchar* unstage_msg,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	GitgCommitActivityUnstageItemData* _data_;
	GitgCommitActivity* _tmp0_;
	GitgStageStatusItem* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	g_return_if_fail (removal_msg != NULL);
	g_return_if_fail (unstage_msg != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityUnstageItemData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_unstage_item_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (item);
	_g_object_unref0 (_data_->item);
	_data_->item = _tmp1_;
	_data_->isnew = isnew;
	_tmp2_ = g_strdup (removal_msg);
	_g_free0 (_data_->removal_msg);
	_data_->removal_msg = _tmp2_;
	_tmp3_ = g_strdup (unstage_msg);
	_g_free0 (_data_->unstage_msg);
	_data_->unstage_msg = _tmp3_;
	gitg_commit_activity_unstage_item_co (_data_);
}

static gboolean
gitg_commit_activity_unstage_item_finish (GitgCommitActivity* self,
                                          GAsyncResult* _res_)
{
	gboolean result;
	GitgCommitActivityUnstageItemData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
gitg_commit_activity_unstage_item_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	GitgCommitActivityUnstageItemData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_unstage_item_co (_data_);
}

static gboolean
gitg_commit_activity_unstage_item_co (GitgCommitActivityUnstageItemData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = gitg_ext_application_get_repository (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = gitg_repository_get_stage (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_;
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp2_);
	_data_->stage = _data_->_tmp8_;
	if (_data_->isnew) {
		{
			_data_->_tmp9_ = _data_->stage;
			_data_->_tmp10_ = gitg_stage_status_item_get_path (_data_->item);
			_data_->_tmp11_ = _data_->_tmp10_;
			_data_->_tmp12_ = _data_->_tmp11_;
			_data_->_state_ = 1;
			gitg_stage_delete_path (_data_->_tmp9_, _data_->_tmp12_, gitg_commit_activity_unstage_item_ready, _data_);
			return FALSE;
			_state_1:
			gitg_stage_delete_path_finish (_data_->_tmp9_, _data_->_res_, &_data_->_inner_error0_);
			_g_free0 (_data_->_tmp12_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp13_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
			_data_->_tmp14_ = _data_->_tmp13_;
			_data_->_tmp15_ = _data_->_tmp14_;
			_data_->_tmp16_ = _data_->e;
			_data_->_tmp17_ = _data_->_tmp16_->message;
			gitg_ext_application_show_infobar (_data_->_tmp15_, _data_->removal_msg, _data_->_tmp17_, GTK_MESSAGE_ERROR);
			_g_object_unref0 (_data_->_tmp15_);
			_data_->result = FALSE;
			_g_error_free0 (_data_->e);
			_g_object_unref0 (_data_->stage);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stage);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	} else {
		{
			_data_->_tmp18_ = _data_->stage;
			_data_->_tmp19_ = gitg_stage_status_item_get_path (_data_->item);
			_data_->_tmp20_ = _data_->_tmp19_;
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_state_ = 2;
			gitg_stage_unstage_path (_data_->_tmp18_, _data_->_tmp21_, gitg_commit_activity_unstage_item_ready, _data_);
			return FALSE;
			_state_2:
			gitg_stage_unstage_path_finish (_data_->_tmp18_, _data_->_res_, &_data_->_inner_error0_);
			_g_free0 (_data_->_tmp21_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
		}
		goto __finally1;
		__catch1_g_error:
		{
			_data_->_vala1_e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp22_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
			_data_->_tmp23_ = _data_->_tmp22_;
			_data_->_tmp24_ = _data_->_tmp23_;
			_data_->_tmp25_ = _data_->_vala1_e;
			_data_->_tmp26_ = _data_->_tmp25_->message;
			gitg_ext_application_show_infobar (_data_->_tmp24_, _data_->unstage_msg, _data_->_tmp26_, GTK_MESSAGE_ERROR);
			_g_object_unref0 (_data_->_tmp24_);
			_data_->result = FALSE;
			_g_error_free0 (_data_->_vala1_e);
			_g_object_unref0 (_data_->stage);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		__finally1:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stage);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->result = TRUE;
	_g_object_unref0 (_data_->stage);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gitg_commit_activity_unstage_file_data_free (gpointer _data)
{
	GitgCommitActivityUnstageFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityUnstageFileData, _data_);
}

static void
gitg_commit_activity_unstage_file (GitgCommitActivity* self,
                                   GitgStageStatusFile* file,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	GitgCommitActivityUnstageFileData* _data_;
	GitgCommitActivity* _tmp0_;
	GitgStageStatusFile* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityUnstageFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_unstage_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (file);
	_g_object_unref0 (_data_->file);
	_data_->file = _tmp1_;
	gitg_commit_activity_unstage_file_co (_data_);
}

static gboolean
gitg_commit_activity_unstage_file_finish (GitgCommitActivity* self,
                                          GAsyncResult* _res_)
{
	gboolean result;
	GitgCommitActivityUnstageFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
gitg_commit_activity_unstage_file_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	GitgCommitActivityUnstageFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_unstage_file_co (_data_);
}

static gboolean
gitg_commit_activity_unstage_file_co (GitgCommitActivityUnstageFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gitg_stage_status_file_get_flags (_data_->file);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->file);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = g_strdup_printf (_ ("Failed to unstage the removal of file “%s”"), _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->file);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = g_strdup_printf (_ ("Failed to unstage the file “%s”"), _data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_state_ = 1;
	gitg_commit_activity_unstage_item (_data_->self, (GitgStageStatusItem*) _data_->file, (_data_->_tmp1_ & GGIT_STATUS_INDEX_NEW) != 0, _data_->_tmp6_, _data_->_tmp11_, gitg_commit_activity_unstage_file_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp12_ = gitg_commit_activity_unstage_item_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->_tmp11_);
	_g_free0 (_data_->_tmp9_);
	_g_free0 (_data_->_tmp6_);
	_g_free0 (_data_->_tmp4_);
	_data_->result = _data_->_tmp12_;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gitg_commit_activity_unstage_submodule_data_free (gpointer _data)
{
	GitgCommitActivityUnstageSubmoduleData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->sub);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityUnstageSubmoduleData, _data_);
}

static void
gitg_commit_activity_unstage_submodule (GitgCommitActivity* self,
                                        GitgStageStatusSubmodule* sub,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	GitgCommitActivityUnstageSubmoduleData* _data_;
	GitgCommitActivity* _tmp0_;
	GitgStageStatusSubmodule* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sub != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityUnstageSubmoduleData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_unstage_submodule_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (sub);
	_g_object_unref0 (_data_->sub);
	_data_->sub = _tmp1_;
	gitg_commit_activity_unstage_submodule_co (_data_);
}

static gboolean
gitg_commit_activity_unstage_submodule_finish (GitgCommitActivity* self,
                                               GAsyncResult* _res_)
{
	gboolean result;
	GitgCommitActivityUnstageSubmoduleData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
gitg_commit_activity_unstage_submodule_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	GitgCommitActivityUnstageSubmoduleData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_unstage_submodule_co (_data_);
}

static gboolean
gitg_commit_activity_unstage_submodule_co (GitgCommitActivityUnstageSubmoduleData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gitg_stage_status_submodule_get_flags (_data_->sub);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->sub);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = g_strdup_printf (_ ("Failed to unstage the removal of submodule “%s”"), _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = gitg_stage_status_item_get_path ((GitgStageStatusItem*) _data_->sub);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = g_strdup_printf (_ ("Failed to unstage the submodule “%s”"), _data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_state_ = 1;
	gitg_commit_activity_unstage_item (_data_->self, (GitgStageStatusItem*) _data_->sub, (_data_->_tmp1_ & GGIT_SUBMODULE_STATUS_INDEX_ADDED) != 0, _data_->_tmp6_, _data_->_tmp11_, gitg_commit_activity_unstage_submodule_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp12_ = gitg_commit_activity_unstage_item_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->_tmp11_);
	_g_free0 (_data_->_tmp9_);
	_g_free0 (_data_->_tmp6_);
	_g_free0 (_data_->_tmp4_);
	_data_->result = _data_->_tmp12_;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
___lambda57_ (GitgCommitActivity* self,
              GObject* obj,
              GAsyncResult* res)
{
	g_return_if_fail (res != NULL);
	gitg_commit_activity_unstage_submodule_finish (self, res);
	gitg_commit_activity_reload (self);
}

static void
____lambda57__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda57_ ((GitgCommitActivity*) self, source_object, res);
	g_object_unref (self);
}

static void
gitg_commit_activity_unstage_submodule_at (GitgCommitActivity* self,
                                           GitgCommit* commit)
{
	GgitCommitParents* parents = NULL;
	GgitCommitParents* _tmp0_;
	GgitCommitParents* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (commit != NULL);
	_tmp0_ = ggit_commit_get_parents ((GgitCommit*) commit);
	parents = _tmp0_;
	_tmp1_ = parents;
	_tmp2_ = ggit_commit_parents_get_size (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != ((guint) 0)) {
		GgitCommitParents* _tmp4_;
		GgitCommit* _tmp5_;
		GitgCommit* _tmp6_;
		GitgCommit* _tmp7_;
		self->priv->d_ignore_external_changes = TRUE;
		_tmp4_ = parents;
		_tmp5_ = ggit_commit_parents_get (_tmp4_, (guint) 0);
		_tmp6_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, GITG_TYPE_COMMIT) ? ((GitgCommit*) _tmp5_) : NULL;
		if (_tmp6_ == NULL) {
			_g_object_unref0 (_tmp5_);
		}
		_tmp7_ = _tmp6_;
		gitg_commit_activity_stage_submodule_at (self, _tmp7_);
		_g_object_unref0 (_tmp7_);
	} else {
		GitgStageStatusSubmodule* _tmp8_;
		self->priv->d_ignore_external_changes = TRUE;
		_tmp8_ = self->priv->d_current_submodule;
		gitg_commit_activity_unstage_submodule (self, _tmp8_, ____lambda57__gasync_ready_callback, g_object_ref (self));
	}
	_g_object_unref0 (parents);
}

static void
gitg_commit_activity_unstage_items_data_free (gpointer _data)
{
	GitgCommitActivityUnstageItemsData* _data_;
	_data_ = _data;
	_data_->items = (_vala_array_free (_data_->items, _data_->items_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityUnstageItemsData, _data_);
}

static void
gitg_commit_activity_unstage_items (GitgCommitActivity* self,
                                    GitgStageStatusItem** items,
                                    gint items_length1,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	GitgCommitActivityUnstageItemsData* _data_;
	GitgCommitActivity* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityUnstageItemsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_unstage_items_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->items = (_vala_array_free (_data_->items, _data_->items_length1, (GDestroyNotify) g_object_unref), NULL);
	_data_->items = items;
	_data_->items_length1 = items_length1;
	gitg_commit_activity_unstage_items_co (_data_);
}

static void
gitg_commit_activity_unstage_items_finish (GitgCommitActivity* self,
                                           GAsyncResult* _res_)
{
	GitgCommitActivityUnstageItemsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
gitg_commit_activity_unstage_items_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	GitgCommitActivityUnstageItemsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_unstage_items_co (_data_);
}

static gboolean
gitg_commit_activity_unstage_items_co (GitgCommitActivityUnstageItemsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->item_collection_length1 = 0;
		_data_->_item_collection_size_ = 0;
		_data_->item_collection = _data_->items;
		_data_->item_collection_length1 = _data_->items_length1;
		for (_data_->item_it = 0; _data_->item_it < _data_->item_collection_length1; _data_->item_it = _data_->item_it + 1) {
			_data_->_tmp0_ = _g_object_ref0 (_data_->item_collection[_data_->item_it]);
			_data_->item = _data_->_tmp0_;
			{
				_data_->ok = TRUE;
				_data_->_tmp1_ = _data_->item;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp1_, GITG_TYPE_STAGE_STATUS_FILE)) {
					_data_->self->priv->d_ignore_external_changes = TRUE;
					_data_->_tmp2_ = _data_->item;
					_data_->_state_ = 1;
					gitg_commit_activity_unstage_file (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp2_, GITG_TYPE_STAGE_STATUS_FILE, GitgStageStatusFile), gitg_commit_activity_unstage_items_ready, _data_);
					return FALSE;
					_state_1:
					_data_->ok = gitg_commit_activity_unstage_file_finish (_data_->self, _data_->_res_);
				} else {
					_data_->_tmp3_ = _data_->item;
					if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp3_, GITG_TYPE_STAGE_STATUS_SUBMODULE)) {
						_data_->self->priv->d_ignore_external_changes = TRUE;
						_data_->_tmp4_ = _data_->item;
						_data_->_state_ = 2;
						gitg_commit_activity_unstage_submodule (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp4_, GITG_TYPE_STAGE_STATUS_SUBMODULE, GitgStageStatusSubmodule), gitg_commit_activity_unstage_items_ready, _data_);
						return FALSE;
						_state_2:
						_data_->ok = gitg_commit_activity_unstage_submodule_finish (_data_->self, _data_->_res_);
					} else {
						g_assert_not_reached ();
					}
				}
				if (!_data_->ok) {
					_g_object_unref0 (_data_->item);
					break;
				}
				_g_object_unref0 (_data_->item);
			}
		}
	}
	gitg_commit_activity_reload (_data_->self);
	_data_->items = (_vala_array_free (_data_->items, _data_->items_length1, (GDestroyNotify) g_object_unref), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static GitgStageStatusItem**
_vala_array_dup6 (GitgStageStatusItem** self,
                  gssize length)
{
	if (length >= 0) {
		GitgStageStatusItem** result;
		gssize i;
		result = g_new0 (GitgStageStatusItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgStageStatusItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
__lambda41_ (GitgCommitActivity* self,
             GObject* obj,
             GAsyncResult* res)
{
	g_return_if_fail (res != NULL);
	gitg_commit_activity_unstage_items_finish (self, res);
}

static void
___lambda41__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda41_ ((GitgCommitActivity*) self, source_object, res);
	g_object_unref (self);
}

static void
gitg_commit_activity_on_staged_activated (GitgCommitActivity* self,
                                          GitgStageStatusItem** items,
                                          gint items_length1)
{
	GitgStageStatusItem** _tmp0_;
	gint _tmp0__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = (items != NULL) ? _vala_array_dup6 (items, items_length1) : items;
	_tmp0__length1 = items_length1;
	gitg_commit_activity_unstage_items (self, _tmp0_, (gint) _tmp0__length1, ___lambda41__gasync_ready_callback, g_object_ref (self));
}

static Block21Data*
block21_data_ref (Block21Data* _data21_)
{
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}

static void
block21_data_unref (void * _userdata_)
{
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data21_->self;
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}

static GitgStageStatusItem**
_vala_array_dup7 (GitgStageStatusItem** self,
                  gssize length)
{
	if (length >= 0) {
		GitgStageStatusItem** result;
		gssize i;
		result = g_new0 (GitgStageStatusItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgStageStatusItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gint
__lambda42_ (GitgCommitActivity* self,
             GitgStageStatusItem* a,
             GitgStageStatusItem* b)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gint _tmp10_;
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	_tmp0_ = gitg_stage_status_item_get_path (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = g_utf8_casefold (_tmp2_, (gssize) -1);
	_tmp4_ = _tmp3_;
	_tmp5_ = gitg_stage_status_item_get_path (b);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp8_ = g_utf8_casefold (_tmp7_, (gssize) -1);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_utf8_collate (_tmp4_, _tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	result = _tmp10_;
	return result;
}

static gint
___lambda42__gcompare_data_func (gconstpointer a,
                                 gconstpointer b,
                                 gpointer self)
{
	gint result;
	result = __lambda42_ ((GitgCommitActivity*) self, (GitgStageStatusItem*) a, (GitgStageStatusItem*) b);
	return result;
}

static Block22Data*
block22_data_ref (Block22Data* _data22_)
{
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}

static void
block22_data_unref (void * _userdata_)
{
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data22_->_data21_->self;
		_g_object_unref0 (_data22_->sitem);
		block21_data_unref (_data22_->_data21_);
		_data22_->_data21_ = NULL;
		g_slice_free (Block22Data, _data22_);
	}
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static void
_vala_array_add7 (GitgCommitSidebarItem** * array,
                  gint* length,
                  gint* size,
                  GitgCommitSidebarItem* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GitgCommitSidebarItem*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
____lambda43_ (Block22Data* _data22_,
               gint numclick)
{
	Block21Data* _data21_;
	GitgCommitActivity* self;
	GitgCommitSidebarItem* _tmp0_;
	_data21_ = _data22_->_data21_;
	self = _data21_->self;
	_tmp0_ = _data22_->sitem;
	_data21_->callback (_tmp0_, _data21_->callback_target);
}

static void
_____lambda43__gitg_sidebar_item_activated (GitgSidebarItem* _sender,
                                            gint numclick,
                                            gpointer self)
{
	____lambda43_ (self, numclick);
}

static GitgCommitSidebarItem**
gitg_commit_activity_append_items (GitgCommitActivity* self,
                                   GitgSidebarStore* model,
                                   GitgStageStatusItem** items,
                                   gint items_length1,
                                   GitgCommitSidebarItemType type,
                                   GeeHashSet* selected_paths,
                                   GitgCommitActivityStageUnstageCallback callback,
                                   gpointer callback_target,
                                   gint* result_length1)
{
	Block21Data* _data21_;
	GitgCommitSidebarItem** ret = NULL;
	GitgCommitSidebarItem** _tmp0_;
	gint ret_length1;
	gint _ret_size_;
	GeeArrayList* sorted = NULL;
	GitgStageStatusItem** _tmp1_;
	gint _tmp1__length1;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	gchar* filter_filename_text = NULL;
	GitgCommitPaned* _tmp4_;
	GtkSearchEntry* _tmp5_;
	GtkSearchEntry* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GitgCommitSidebarItem** _tmp38_;
	gint _tmp38__length1;
	GitgCommitSidebarItem** result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (model != NULL, NULL);
	_data21_ = g_slice_new0 (Block21Data);
	_data21_->_ref_count_ = 1;
	_data21_->self = g_object_ref (self);
	_data21_->callback = callback;
	_data21_->callback_target = callback_target;
	_tmp0_ = g_new0 (GitgCommitSidebarItem*, 0 + 1);
	ret = _tmp0_;
	ret_length1 = 0;
	_ret_size_ = ret_length1;
	_tmp1_ = (items != NULL) ? _vala_array_dup7 (items, items_length1) : items;
	_tmp1__length1 = items_length1;
	_tmp2_ = gee_array_list_new_wrap (GITG_TYPE_STAGE_STATUS_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_, _tmp1__length1, NULL, NULL, NULL);
	sorted = _tmp2_;
	_tmp3_ = sorted;
	gee_list_sort ((GeeList*) _tmp3_, ___lambda42__gcompare_data_func, g_object_ref (self), g_object_unref);
	_tmp4_ = self->priv->d_main;
	_tmp5_ = gitg_commit_paned_get_commit_files_search_entry (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = gtk_entry_get_text ((GtkEntry*) _tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strdup (_tmp8_);
	filter_filename_text = _tmp9_;
	{
		GeeArrayList* _item_list = NULL;
		GeeArrayList* _tmp10_;
		gint _item_size = 0;
		GeeArrayList* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gint _item_index = 0;
		_tmp10_ = sorted;
		_item_list = _tmp10_;
		_tmp11_ = _item_list;
		_tmp12_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp11_);
		_tmp13_ = _tmp12_;
		_item_size = _tmp13_;
		_item_index = -1;
		while (TRUE) {
			Block22Data* _data22_;
			gint _tmp14_;
			gint _tmp15_;
			GitgStageStatusItem* item = NULL;
			GeeArrayList* _tmp16_;
			gpointer _tmp17_;
			GitgStageStatusItem* _tmp18_;
			GitgCommitSidebarItem* _tmp19_;
			gboolean filter_passed = FALSE;
			GitgStageStatusItem* _tmp20_;
			gchar* _tmp21_;
			gchar* _tmp22_;
			gchar* _tmp23_;
			const gchar* _tmp24_;
			gboolean _tmp25_;
			gboolean _tmp26_ = FALSE;
			gboolean _tmp27_ = FALSE;
			GitgCommitSidebarItem* _tmp34_;
			_data22_ = g_slice_new0 (Block22Data);
			_data22_->_ref_count_ = 1;
			_data22_->_data21_ = block21_data_ref (_data21_);
			_item_index = _item_index + 1;
			_tmp14_ = _item_index;
			_tmp15_ = _item_size;
			if (!(_tmp14_ < _tmp15_)) {
				block22_data_unref (_data22_);
				_data22_ = NULL;
				break;
			}
			_tmp16_ = _item_list;
			_tmp17_ = gee_abstract_list_get ((GeeAbstractList*) _tmp16_, _item_index);
			item = (GitgStageStatusItem*) _tmp17_;
			_tmp18_ = item;
			_tmp19_ = gitg_commit_sidebar_item_new (_tmp18_, type);
			_data22_->sitem = _tmp19_;
			_tmp20_ = item;
			_tmp21_ = gitg_stage_status_item_get_path (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = _tmp22_;
			_tmp24_ = filter_filename_text;
			_tmp25_ = string_contains (_tmp23_, _tmp24_);
			_g_free0 (_tmp23_);
			filter_passed = _tmp25_;
			if (selected_paths != NULL) {
				GitgStageStatusItem* _tmp28_;
				gchar* _tmp29_;
				gchar* _tmp30_;
				gchar* _tmp31_;
				_tmp28_ = item;
				_tmp29_ = gitg_stage_status_item_get_path (_tmp28_);
				_tmp30_ = _tmp29_;
				_tmp31_ = _tmp30_;
				_tmp27_ = gee_abstract_collection_contains ((GeeAbstractCollection*) selected_paths, _tmp31_);
				_g_free0 (_tmp31_);
			} else {
				_tmp27_ = FALSE;
			}
			if (_tmp27_) {
				_tmp26_ = filter_passed;
			} else {
				_tmp26_ = FALSE;
			}
			if (_tmp26_) {
				GitgCommitSidebarItem* _tmp32_;
				GitgCommitSidebarItem* _tmp33_;
				_tmp32_ = _data22_->sitem;
				_tmp33_ = _g_object_ref0 (_tmp32_);
				_vala_array_add7 (&ret, &ret_length1, &_ret_size_, _tmp33_);
			}
			_tmp34_ = _data22_->sitem;
			g_signal_connect_data ((GitgSidebarItem*) _tmp34_, "activated", (GCallback) _____lambda43__gitg_sidebar_item_activated, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
			if (filter_passed) {
				GitgCommitSidebarItem* _tmp35_;
				GitgSidebarStore* _tmp36_;
				GitgSidebarStore* _tmp37_;
				_tmp35_ = _data22_->sitem;
				_tmp36_ = gitg_sidebar_store_append (model, (GitgSidebarItem*) _tmp35_);
				_tmp37_ = _tmp36_;
				_g_object_unref0 (_tmp37_);
			}
			_g_object_unref0 (item);
			block22_data_unref (_data22_);
			_data22_ = NULL;
		}
	}
	_tmp38_ = ret;
	_tmp38__length1 = ret_length1;
	if (result_length1) {
		*result_length1 = _tmp38__length1;
	}
	result = _tmp38_;
	_g_free0 (filter_filename_text);
	_g_object_unref0 (sorted);
	block21_data_unref (_data21_);
	_data21_ = NULL;
	return result;
}

static Block23Data*
block23_data_ref (Block23Data* _data23_)
{
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}

static void
block23_data_unref (void * _userdata_)
{
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data23_->self;
		_g_object_unref0 (_data23_->enumerator);
		_g_object_unref0 (_data23_->selected_paths);
		_g_object_unref0 (_data23_->model);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}

static Block24Data*
block24_data_ref (Block24Data* _data24_)
{
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}

static void
block24_data_unref (void * _userdata_)
{
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data24_->_data23_->self;
		_g_object_unref0 (_data24_->ac);
		block23_data_unref (_data24_->_data23_);
		_data24_->_data23_ = NULL;
		g_slice_free (Block24Data, _data24_);
	}
}

static void
____lambda38_ (Block24Data* _data24_,
               GObject* obj,
               GAsyncResult* res)
{
	Block23Data* _data23_;
	GitgCommitActivity* self;
	GitgAvatarCache* _tmp0_;
	GdkPixbuf* _tmp1_;
	GdkPixbuf* _tmp2_;
	_data23_ = _data24_->_data23_;
	self = _data23_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = _data24_->ac;
	_tmp1_ = gitg_avatar_cache_load_finish (_tmp0_, res);
	_tmp2_ = _tmp1_;
	_g_object_unref0 (_tmp2_);
}

static void
_____lambda38__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	____lambda38_ (self, source_object, res);
	block24_data_unref (self);
}

static void
_vala_array_add8 (GitgStageStatusItem** * array,
                  gint* length,
                  gint* size,
                  GitgStageStatusItem* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GitgStageStatusItem*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add9 (GitgStageStatusItem** * array,
                  gint* length,
                  gint* size,
                  GitgStageStatusItem* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GitgStageStatusItem*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add10 (GitgStageStatusItem** * array,
                   gint* length,
                   gint* size,
                   GitgStageStatusItem* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GitgStageStatusItem*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add11 (GitgStageStatusItem** * array,
                   gint* length,
                   gint* size,
                   GitgStageStatusItem* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GitgStageStatusItem*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
__lambda40_ (GitgCommitActivity* self,
             gint numclick)
{
	gitg_commit_activity_on_unstage_selected_items (self);
}

static void
___lambda40__gitg_sidebar_item_activated (GitgSidebarItem* _sender,
                                          gint numclick,
                                          gpointer self)
{
	__lambda40_ ((GitgCommitActivity*) self, numclick);
}

static void
___lambda44_ (GitgCommitActivity* self,
              GitgCommitSidebarItem* item)
{
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	if (gitg_sidebar_is_selected ((GitgSidebar*) _tmp2_, (GitgSidebarItem*) item)) {
		gitg_commit_activity_on_unstage_selected_items (self);
	} else {
		GitgStageStatusItem* _tmp3_;
		GitgStageStatusItem* _tmp4_;
		GitgStageStatusItem* _tmp5_;
		GitgStageStatusItem** _tmp6_;
		GitgStageStatusItem** _tmp7_;
		gint _tmp7__length1;
		_tmp3_ = gitg_commit_sidebar_item_get_item (item);
		_tmp4_ = _tmp3_;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_tmp6_ = g_new0 (GitgStageStatusItem*, 1 + 1);
		_tmp6_[0] = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp7__length1 = 1;
		gitg_commit_activity_on_staged_activated (self, _tmp7_, (gint) 1);
		_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_object_unref), NULL);
	}
}

static void
____lambda44__gitg_commit_activity_stage_unstage_callback (GitgCommitSidebarItem* item,
                                                           gpointer self)
{
	___lambda44_ ((GitgCommitActivity*) self, item);
}

static void
__lambda45_ (GitgCommitActivity* self,
             gint numclick)
{
	gitg_commit_activity_on_stage_selected_items (self);
}

static void
___lambda45__gitg_sidebar_item_activated (GitgSidebarItem* _sender,
                                          gint numclick,
                                          gpointer self)
{
	__lambda45_ ((GitgCommitActivity*) self, numclick);
}

static void
___lambda47_ (GitgCommitActivity* self,
              GitgCommitSidebarItem* item)
{
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	if (gitg_sidebar_is_selected ((GitgSidebar*) _tmp2_, (GitgSidebarItem*) item)) {
		gitg_commit_activity_on_stage_selected_items (self);
	} else {
		GitgStageStatusItem* _tmp3_;
		GitgStageStatusItem* _tmp4_;
		GitgStageStatusItem* _tmp5_;
		GitgStageStatusItem** _tmp6_;
		GitgStageStatusItem** _tmp7_;
		gint _tmp7__length1;
		_tmp3_ = gitg_commit_sidebar_item_get_item (item);
		_tmp4_ = _tmp3_;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_tmp6_ = g_new0 (GitgStageStatusItem*, 1 + 1);
		_tmp6_[0] = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp7__length1 = 1;
		gitg_commit_activity_on_unstaged_activated (self, _tmp7_, (gint) 1);
		_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_object_unref), NULL);
	}
}

static void
____lambda47__gitg_commit_activity_stage_unstage_callback (GitgCommitSidebarItem* item,
                                                           gpointer self)
{
	___lambda47_ ((GitgCommitActivity*) self, item);
}

static void
___lambda48_ (GitgCommitActivity* self,
              GitgCommitSidebarItem* item)
{
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	if (gitg_sidebar_is_selected ((GitgSidebar*) _tmp2_, (GitgSidebarItem*) item)) {
		gitg_commit_activity_on_stage_selected_items (self);
	} else {
		GitgStageStatusItem* _tmp3_;
		GitgStageStatusItem* _tmp4_;
		GitgStageStatusItem* _tmp5_;
		GitgStageStatusItem** _tmp6_;
		GitgStageStatusItem** _tmp7_;
		gint _tmp7__length1;
		_tmp3_ = gitg_commit_sidebar_item_get_item (item);
		_tmp4_ = _tmp3_;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_tmp6_ = g_new0 (GitgStageStatusItem*, 1 + 1);
		_tmp6_[0] = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp7__length1 = 1;
		gitg_commit_activity_on_unstaged_activated (self, _tmp7_, (gint) 1);
		_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_object_unref), NULL);
	}
}

static void
____lambda48__gitg_commit_activity_stage_unstage_callback (GitgCommitSidebarItem* item,
                                                           gpointer self)
{
	___lambda48_ ((GitgCommitActivity*) self, item);
}

static void
____lambda49_ (GitgCommitActivity* self,
               GitgCommitSidebarItem* item)
{
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	if (gitg_sidebar_is_selected ((GitgSidebar*) _tmp2_, (GitgSidebarItem*) item)) {
		gitg_commit_activity_on_stage_selected_items (self);
	} else {
		GitgStageStatusItem* _tmp3_;
		GitgStageStatusItem* _tmp4_;
		GitgStageStatusItem* _tmp5_;
		GitgStageStatusItem** _tmp6_;
		GitgStageStatusItem** _tmp7_;
		gint _tmp7__length1;
		_tmp3_ = gitg_commit_sidebar_item_get_item (item);
		_tmp4_ = _tmp3_;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_tmp6_ = g_new0 (GitgStageStatusItem*, 1 + 1);
		_tmp6_[0] = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp7__length1 = 1;
		gitg_commit_activity_on_unstaged_activated (self, _tmp7_, (gint) 1);
		_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_object_unref), NULL);
	}
}

static void
_____lambda49__gitg_commit_activity_stage_unstage_callback (GitgCommitSidebarItem* item,
                                                            gpointer self)
{
	____lambda49_ ((GitgCommitActivity*) self, item);
}

static GitgCommitSidebarItem**
_vala_array_dup8 (GitgCommitSidebarItem** self,
                  gssize length)
{
	if (length >= 0) {
		GitgCommitSidebarItem** result;
		gssize i;
		result = g_new0 (GitgCommitSidebarItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgCommitSidebarItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GitgCommitSidebarItem**
_vala_array_dup9 (GitgCommitSidebarItem** self,
                  gssize length)
{
	if (length >= 0) {
		GitgCommitSidebarItem** result;
		gssize i;
		result = g_new0 (GitgCommitSidebarItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgCommitSidebarItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GitgCommitSidebarItem**
_vala_array_dup10 (GitgCommitSidebarItem** self,
                   gssize length)
{
	if (length >= 0) {
		GitgCommitSidebarItem** result;
		gssize i;
		result = g_new0 (GitgCommitSidebarItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgCommitSidebarItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GitgCommitSidebarItem**
_vala_array_dup11 (GitgCommitSidebarItem** self,
                   gssize length)
{
	if (length >= 0) {
		GitgCommitSidebarItem** result;
		gssize i;
		result = g_new0 (GitgCommitSidebarItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgCommitSidebarItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GitgCommitSidebarItem**
_vala_array_dup12 (GitgCommitSidebarItem** self,
                   gssize length)
{
	if (length >= 0) {
		GitgCommitSidebarItem** result;
		gssize i;
		result = g_new0 (GitgCommitSidebarItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgCommitSidebarItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GitgCommitSidebarItem**
_vala_array_dup13 (GitgCommitSidebarItem** self,
                   gssize length)
{
	if (length >= 0) {
		GitgCommitSidebarItem** result;
		gssize i;
		result = g_new0 (GitgCommitSidebarItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgCommitSidebarItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GitgCommitSidebarItem**
_vala_array_dup14 (GitgCommitSidebarItem** self,
                   gssize length)
{
	if (length >= 0) {
		GitgCommitSidebarItem** result;
		gssize i;
		result = g_new0 (GitgCommitSidebarItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgCommitSidebarItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GitgCommitSidebarItem**
_vala_array_dup15 (GitgCommitSidebarItem** self,
                   gssize length)
{
	if (length >= 0) {
		GitgCommitSidebarItem** result;
		gssize i;
		result = g_new0 (GitgCommitSidebarItem*, length + 1);
		for (i = 0; i < length; i++) {
			GitgCommitSidebarItem* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
__lambda39_ (Block23Data* _data23_,
             GObject* obj,
             GAsyncResult* res)
{
	GitgCommitActivity* self;
	GitgStageStatusItem** items = NULL;
	GitgStageStatusEnumerator* _tmp0_;
	gint _tmp1_ = 0;
	GitgStageStatusItem** _tmp2_;
	gint items_length1;
	gint _items_size_;
	GitgStageStatusItem** staged = NULL;
	GitgStageStatusItem** _tmp3_;
	gint _tmp3__length1;
	GitgStageStatusItem** _tmp4_;
	gint staged_length1;
	gint _staged_size_;
	GitgStageStatusItem** unstaged = NULL;
	GitgStageStatusItem** _tmp5_;
	gint _tmp5__length1;
	GitgStageStatusItem** _tmp6_;
	gint unstaged_length1;
	gint _unstaged_size_;
	GitgStageStatusItem** untracked = NULL;
	GitgStageStatusItem** _tmp7_;
	gint _tmp7__length1;
	GitgStageStatusItem** _tmp8_;
	gint untracked_length1;
	gint _untracked_size_;
	GitgStageStatusItem** dirty = NULL;
	GitgStageStatusItem** _tmp9_;
	gint _tmp9__length1;
	GitgStageStatusItem** _tmp10_;
	gint dirty_length1;
	gint _dirty_size_;
	gboolean hassub = FALSE;
	GitgStageStatusItem** _tmp11_;
	gint _tmp11__length1;
	GitgSidebarStore* _tmp36_;
	GitgCommitPaned* _tmp37_;
	GitgDiffView* _tmp38_;
	GitgDiffView* _tmp39_;
	GitgCommitSidebarItem** current_staged = NULL;
	GitgCommitSidebarItem** _tmp40_;
	gint current_staged_length1;
	gint _current_staged_size_;
	GitgCommitSidebarItem** current_unstaged = NULL;
	GitgCommitSidebarItem** _tmp41_;
	gint current_unstaged_length1;
	gint _current_unstaged_size_;
	GitgCommitSidebarItem** current_untracked = NULL;
	GitgCommitSidebarItem** _tmp42_;
	gint current_untracked_length1;
	gint _current_untracked_size_;
	GitgCommitSidebarItem** current_submodules = NULL;
	GitgCommitSidebarItem** _tmp43_;
	gint current_submodules_length1;
	gint _current_submodules_size_;
	GitgSidebarStoreSidebarHeader* staged_header = NULL;
	GitgSidebarStore* _tmp44_;
	GitgSidebarStoreSidebarHeader* _tmp45_;
	GitgSidebarStoreSidebarHeader* _tmp46_;
	GitgStageStatusItem** _tmp47_;
	gint _tmp47__length1;
	GitgSidebarStore* _tmp56_;
	GitgSidebarStore* _tmp57_;
	GitgSidebarStore* _tmp58_;
	GitgSidebarStoreSidebarHeader* unstaged_header = NULL;
	GitgSidebarStore* _tmp59_;
	GitgSidebarStoreSidebarHeader* _tmp60_;
	GitgSidebarStoreSidebarHeader* _tmp61_;
	GitgStageStatusItem** _tmp62_;
	gint _tmp62__length1;
	GitgSidebarStore* _tmp71_;
	GitgSidebarStore* _tmp72_;
	GitgSidebarStore* _tmp73_;
	GitgSidebarStore* _tmp74_;
	GitgSidebarStoreSidebarHeader* _tmp75_;
	GitgSidebarStoreSidebarHeader* _tmp76_;
	GitgStageStatusItem** _tmp77_;
	gint _tmp77__length1;
	GitgSidebarStore* _tmp86_;
	GitgSidebarStore* _tmp87_;
	GitgSidebarStore* _tmp88_;
	GitgCommitPaned* _tmp104_;
	GitgCommitSidebar* _tmp105_;
	GitgCommitSidebar* _tmp106_;
	GitgStageStatusItem** _tmp107_;
	gint _tmp107__length1;
	GeeHashSet* _tmp108_;
	gint _tmp109_;
	gint _tmp110_;
	self = _data23_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = _data23_->enumerator;
	_tmp2_ = gitg_stage_status_enumerator_next_items_finish (_tmp0_, res, &_tmp1_);
	items = _tmp2_;
	items_length1 = _tmp1_;
	_items_size_ = items_length1;
	_tmp3_ = items;
	_tmp3__length1 = items_length1;
	_tmp4_ = g_new0 (GitgStageStatusItem*, _tmp3__length1 + 1);
	staged = _tmp4_;
	staged_length1 = _tmp3__length1;
	_staged_size_ = staged_length1;
	staged_length1 = 0;
	_tmp5_ = items;
	_tmp5__length1 = items_length1;
	_tmp6_ = g_new0 (GitgStageStatusItem*, _tmp5__length1 + 1);
	unstaged = _tmp6_;
	unstaged_length1 = _tmp5__length1;
	_unstaged_size_ = unstaged_length1;
	unstaged_length1 = 0;
	_tmp7_ = items;
	_tmp7__length1 = items_length1;
	_tmp8_ = g_new0 (GitgStageStatusItem*, _tmp7__length1 + 1);
	untracked = _tmp8_;
	untracked_length1 = _tmp7__length1;
	_untracked_size_ = untracked_length1;
	untracked_length1 = 0;
	_tmp9_ = items;
	_tmp9__length1 = items_length1;
	_tmp10_ = g_new0 (GitgStageStatusItem*, _tmp9__length1 + 1);
	dirty = _tmp10_;
	dirty_length1 = _tmp9__length1;
	_dirty_size_ = dirty_length1;
	dirty_length1 = 0;
	hassub = FALSE;
	_tmp11_ = items;
	_tmp11__length1 = items_length1;
	{
		GitgStageStatusItem** item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = _tmp11_;
		item_collection_length1 = _tmp11__length1;
		for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) {
			GitgStageStatusItem* _tmp12_;
			GitgStageStatusItem* item = NULL;
			_tmp12_ = _g_object_ref0 (item_collection[item_it]);
			item = _tmp12_;
			{
				GitgStageStatusItem* _tmp13_;
				gboolean _tmp14_;
				gboolean _tmp15_;
				GitgStageStatusItem* _tmp18_;
				gboolean _tmp19_;
				gboolean _tmp20_;
				GitgStageStatusItem* _tmp23_;
				gboolean _tmp24_;
				gboolean _tmp25_;
				GitgStageStatusSubmodule* sub = NULL;
				GitgStageStatusItem* _tmp28_;
				GitgStageStatusSubmodule* _tmp29_;
				GitgStageStatusSubmodule* _tmp30_;
				_tmp13_ = item;
				_tmp14_ = gitg_stage_status_item_get_is_staged (_tmp13_);
				_tmp15_ = _tmp14_;
				if (_tmp15_) {
					GitgStageStatusItem* _tmp16_;
					GitgStageStatusItem* _tmp17_;
					_tmp16_ = item;
					_tmp17_ = _g_object_ref0 (_tmp16_);
					_vala_array_add8 (&staged, &staged_length1, &_staged_size_, _tmp17_);
				}
				_tmp18_ = item;
				_tmp19_ = gitg_stage_status_item_get_is_unstaged (_tmp18_);
				_tmp20_ = _tmp19_;
				if (_tmp20_) {
					GitgStageStatusItem* _tmp21_;
					GitgStageStatusItem* _tmp22_;
					_tmp21_ = item;
					_tmp22_ = _g_object_ref0 (_tmp21_);
					_vala_array_add9 (&unstaged, &unstaged_length1, &_unstaged_size_, _tmp22_);
				}
				_tmp23_ = item;
				_tmp24_ = gitg_stage_status_item_get_is_untracked (_tmp23_);
				_tmp25_ = _tmp24_;
				if (_tmp25_) {
					GitgStageStatusItem* _tmp26_;
					GitgStageStatusItem* _tmp27_;
					_tmp26_ = item;
					_tmp27_ = _g_object_ref0 (_tmp26_);
					_vala_array_add10 (&untracked, &untracked_length1, &_untracked_size_, _tmp27_);
				}
				_tmp28_ = item;
				_tmp29_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp28_, GITG_TYPE_STAGE_STATUS_SUBMODULE) ? ((GitgStageStatusSubmodule*) _tmp28_) : NULL);
				sub = _tmp29_;
				_tmp30_ = sub;
				if (_tmp30_ != NULL) {
					GitgStageStatusSubmodule* _tmp31_;
					gboolean _tmp32_;
					gboolean _tmp33_;
					hassub = TRUE;
					_tmp31_ = sub;
					_tmp32_ = gitg_stage_status_submodule_get_is_dirty (_tmp31_);
					_tmp33_ = _tmp32_;
					if (_tmp33_) {
						GitgStageStatusItem* _tmp34_;
						GitgStageStatusItem* _tmp35_;
						_tmp34_ = item;
						_tmp35_ = _g_object_ref0 (_tmp34_);
						_vala_array_add11 (&dirty, &dirty_length1, &_dirty_size_, _tmp35_);
					}
				}
				_g_object_unref0 (sub);
				_g_object_unref0 (item);
			}
		}
	}
	_tmp36_ = _data23_->model;
	gitg_sidebar_store_clear (_tmp36_);
	_tmp37_ = self->priv->d_main;
	_tmp38_ = gitg_commit_paned_get_diff_view (_tmp37_);
	_tmp39_ = _tmp38_;
	gitg_diff_view_set_diff (_tmp39_, NULL);
	_tmp40_ = g_new0 (GitgCommitSidebarItem*, 0 + 1);
	current_staged = _tmp40_;
	current_staged_length1 = 0;
	_current_staged_size_ = current_staged_length1;
	_tmp41_ = g_new0 (GitgCommitSidebarItem*, 0 + 1);
	current_unstaged = _tmp41_;
	current_unstaged_length1 = 0;
	_current_unstaged_size_ = current_unstaged_length1;
	_tmp42_ = g_new0 (GitgCommitSidebarItem*, 0 + 1);
	current_untracked = _tmp42_;
	current_untracked_length1 = 0;
	_current_untracked_size_ = current_untracked_length1;
	_tmp43_ = g_new0 (GitgCommitSidebarItem*, 0 + 1);
	current_submodules = _tmp43_;
	current_submodules_length1 = 0;
	_current_submodules_size_ = current_submodules_length1;
	_tmp44_ = _data23_->model;
	_tmp45_ = gitg_sidebar_store_begin_header (_tmp44_, _ ("Staged"), (guint) GITG_COMMIT_SIDEBAR_ITEM_TYPE_STAGED);
	staged_header = _tmp45_;
	_tmp46_ = staged_header;
	g_signal_connect_object ((GitgSidebarItem*) _tmp46_, "activated", (GCallback) ___lambda40__gitg_sidebar_item_activated, self, 0);
	_tmp47_ = staged;
	_tmp47__length1 = staged_length1;
	if (_tmp47__length1 == 0) {
		GitgSidebarStore* _tmp48_;
		GitgSidebarStore* _tmp49_;
		GitgSidebarStore* _tmp50_;
		_tmp48_ = _data23_->model;
		_tmp49_ = gitg_sidebar_store_append_dummy (_tmp48_, _ ("No staged files"));
		_tmp50_ = _tmp49_;
		_g_object_unref0 (_tmp50_);
	} else {
		GitgSidebarStore* _tmp51_;
		GitgStageStatusItem** _tmp52_;
		gint _tmp52__length1;
		GeeHashSet* _tmp53_;
		gint _tmp54_ = 0;
		GitgCommitSidebarItem** _tmp55_;
		_tmp51_ = _data23_->model;
		_tmp52_ = staged;
		_tmp52__length1 = staged_length1;
		_tmp53_ = _data23_->selected_paths;
		_tmp55_ = gitg_commit_activity_append_items (self, _tmp51_, _tmp52_, (gint) _tmp52__length1, GITG_COMMIT_SIDEBAR_ITEM_TYPE_STAGED, _tmp53_, ____lambda44__gitg_commit_activity_stage_unstage_callback, self, &_tmp54_);
		current_staged = (_vala_array_free (current_staged, current_staged_length1, (GDestroyNotify) g_object_unref), NULL);
		current_staged = _tmp55_;
		current_staged_length1 = _tmp54_;
		_current_staged_size_ = current_staged_length1;
	}
	_tmp56_ = _data23_->model;
	_tmp57_ = gitg_sidebar_store_end_header (_tmp56_);
	_tmp58_ = _tmp57_;
	_g_object_unref0 (_tmp58_);
	_tmp59_ = _data23_->model;
	_tmp60_ = gitg_sidebar_store_begin_header (_tmp59_, _ ("Unstaged"), (guint) GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNSTAGED);
	unstaged_header = _tmp60_;
	_tmp61_ = unstaged_header;
	g_signal_connect_object ((GitgSidebarItem*) _tmp61_, "activated", (GCallback) ___lambda45__gitg_sidebar_item_activated, self, 0);
	_tmp62_ = unstaged;
	_tmp62__length1 = unstaged_length1;
	if (_tmp62__length1 == 0) {
		GitgSidebarStore* _tmp63_;
		GitgSidebarStore* _tmp64_;
		GitgSidebarStore* _tmp65_;
		_tmp63_ = _data23_->model;
		_tmp64_ = gitg_sidebar_store_append_dummy (_tmp63_, _ ("No unstaged files"));
		_tmp65_ = _tmp64_;
		_g_object_unref0 (_tmp65_);
	} else {
		GitgSidebarStore* _tmp66_;
		GitgStageStatusItem** _tmp67_;
		gint _tmp67__length1;
		GeeHashSet* _tmp68_;
		gint _tmp69_ = 0;
		GitgCommitSidebarItem** _tmp70_;
		_tmp66_ = _data23_->model;
		_tmp67_ = unstaged;
		_tmp67__length1 = unstaged_length1;
		_tmp68_ = _data23_->selected_paths;
		_tmp70_ = gitg_commit_activity_append_items (self, _tmp66_, _tmp67_, (gint) _tmp67__length1, GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNSTAGED, _tmp68_, ____lambda47__gitg_commit_activity_stage_unstage_callback, self, &_tmp69_);
		current_unstaged = (_vala_array_free (current_unstaged, current_unstaged_length1, (GDestroyNotify) g_object_unref), NULL);
		current_unstaged = _tmp70_;
		current_unstaged_length1 = _tmp69_;
		_current_unstaged_size_ = current_unstaged_length1;
	}
	_tmp71_ = _data23_->model;
	_tmp72_ = gitg_sidebar_store_end_header (_tmp71_);
	_tmp73_ = _tmp72_;
	_g_object_unref0 (_tmp73_);
	_tmp74_ = _data23_->model;
	_tmp75_ = gitg_sidebar_store_begin_header (_tmp74_, _ ("Untracked"), (guint) GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNTRACKED);
	_tmp76_ = _tmp75_;
	_g_object_unref0 (_tmp76_);
	_tmp77_ = untracked;
	_tmp77__length1 = untracked_length1;
	if (_tmp77__length1 == 0) {
		GitgSidebarStore* _tmp78_;
		GitgSidebarStore* _tmp79_;
		GitgSidebarStore* _tmp80_;
		_tmp78_ = _data23_->model;
		_tmp79_ = gitg_sidebar_store_append_dummy (_tmp78_, _ ("No untracked files"));
		_tmp80_ = _tmp79_;
		_g_object_unref0 (_tmp80_);
	} else {
		GitgSidebarStore* _tmp81_;
		GitgStageStatusItem** _tmp82_;
		gint _tmp82__length1;
		GeeHashSet* _tmp83_;
		gint _tmp84_ = 0;
		GitgCommitSidebarItem** _tmp85_;
		_tmp81_ = _data23_->model;
		_tmp82_ = untracked;
		_tmp82__length1 = untracked_length1;
		_tmp83_ = _data23_->selected_paths;
		_tmp85_ = gitg_commit_activity_append_items (self, _tmp81_, _tmp82_, (gint) _tmp82__length1, GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNTRACKED, _tmp83_, ____lambda48__gitg_commit_activity_stage_unstage_callback, self, &_tmp84_);
		current_untracked = (_vala_array_free (current_untracked, current_untracked_length1, (GDestroyNotify) g_object_unref), NULL);
		current_untracked = _tmp85_;
		current_untracked_length1 = _tmp84_;
		_current_untracked_size_ = current_untracked_length1;
	}
	_tmp86_ = _data23_->model;
	_tmp87_ = gitg_sidebar_store_end_header (_tmp86_);
	_tmp88_ = _tmp87_;
	_g_object_unref0 (_tmp88_);
	if (hassub) {
		GitgSidebarStore* _tmp89_;
		GitgSidebarStoreSidebarHeader* _tmp90_;
		GitgSidebarStoreSidebarHeader* _tmp91_;
		GitgStageStatusItem** _tmp92_;
		gint _tmp92__length1;
		GitgSidebarStore* _tmp101_;
		GitgSidebarStore* _tmp102_;
		GitgSidebarStore* _tmp103_;
		_tmp89_ = _data23_->model;
		_tmp90_ = gitg_sidebar_store_begin_header (_tmp89_, _ ("Submodule"), (guint) GITG_COMMIT_SIDEBAR_ITEM_TYPE_SUBMODULE);
		_tmp91_ = _tmp90_;
		_g_object_unref0 (_tmp91_);
		_tmp92_ = dirty;
		_tmp92__length1 = dirty_length1;
		if (_tmp92__length1 == 0) {
			GitgSidebarStore* _tmp93_;
			GitgSidebarStore* _tmp94_;
			GitgSidebarStore* _tmp95_;
			_tmp93_ = _data23_->model;
			_tmp94_ = gitg_sidebar_store_append_dummy (_tmp93_, _ ("No dirty submodules"));
			_tmp95_ = _tmp94_;
			_g_object_unref0 (_tmp95_);
		} else {
			GitgSidebarStore* _tmp96_;
			GitgStageStatusItem** _tmp97_;
			gint _tmp97__length1;
			GeeHashSet* _tmp98_;
			gint _tmp99_ = 0;
			GitgCommitSidebarItem** _tmp100_;
			_tmp96_ = _data23_->model;
			_tmp97_ = dirty;
			_tmp97__length1 = dirty_length1;
			_tmp98_ = _data23_->selected_paths;
			_tmp100_ = gitg_commit_activity_append_items (self, _tmp96_, _tmp97_, (gint) _tmp97__length1, GITG_COMMIT_SIDEBAR_ITEM_TYPE_SUBMODULE, _tmp98_, _____lambda49__gitg_commit_activity_stage_unstage_callback, self, &_tmp99_);
			current_submodules = (_vala_array_free (current_submodules, current_submodules_length1, (GDestroyNotify) g_object_unref), NULL);
			current_submodules = _tmp100_;
			current_submodules_length1 = _tmp99_;
			_current_submodules_size_ = current_submodules_length1;
		}
		_tmp101_ = _data23_->model;
		_tmp102_ = gitg_sidebar_store_end_header (_tmp101_);
		_tmp103_ = _tmp102_;
		_g_object_unref0 (_tmp103_);
	}
	_tmp104_ = self->priv->d_main;
	_tmp105_ = gitg_commit_paned_get_sidebar (_tmp104_);
	_tmp106_ = _tmp105_;
	gtk_tree_view_expand_all ((GtkTreeView*) _tmp106_);
	_tmp107_ = staged;
	_tmp107__length1 = staged_length1;
	self->priv->d_has_staged = _tmp107__length1 != 0;
	self->priv->d_reloading = FALSE;
	_tmp108_ = _data23_->selected_paths;
	_tmp109_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp108_);
	_tmp110_ = _tmp109_;
	if (_tmp110_ != 0) {
		GitgCommitSidebarItem** sel = NULL;
		gint sel_length1;
		gint _sel_size_;
		gboolean _tmp119_ = FALSE;
		GitgCommitSidebarItem** _tmp120_;
		gint _tmp120__length1;
		gboolean _tmp124_ = FALSE;
		GitgCommitSidebarItem** _tmp125_;
		gint _tmp125__length1;
		gboolean _tmp129_ = FALSE;
		GitgCommitSidebarItem** _tmp130_;
		gint _tmp130__length1;
		gboolean _tmp134_ = FALSE;
		GitgCommitSidebarItem** _tmp135_;
		gint _tmp135__length1;
		gboolean _tmp139_ = FALSE;
		GitgCommitSidebarItem** _tmp140_;
		gint _tmp140__length1;
		sel = NULL;
		sel_length1 = 0;
		_sel_size_ = sel_length1;
		switch (_data23_->selected_type) {
			case GITG_COMMIT_SIDEBAR_ITEM_TYPE_STAGED:
			{
				GitgCommitSidebarItem** _tmp111_;
				gint _tmp111__length1;
				GitgCommitSidebarItem** _tmp112_;
				gint _tmp112__length1;
				_tmp111_ = current_staged;
				_tmp111__length1 = current_staged_length1;
				_tmp112_ = (_tmp111_ != NULL) ? _vala_array_dup8 (_tmp111_, _tmp111__length1) : _tmp111_;
				_tmp112__length1 = _tmp111__length1;
				sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
				sel = _tmp112_;
				sel_length1 = _tmp112__length1;
				_sel_size_ = sel_length1;
				break;
			}
			case GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNSTAGED:
			{
				GitgCommitSidebarItem** _tmp113_;
				gint _tmp113__length1;
				GitgCommitSidebarItem** _tmp114_;
				gint _tmp114__length1;
				_tmp113_ = current_unstaged;
				_tmp113__length1 = current_unstaged_length1;
				_tmp114_ = (_tmp113_ != NULL) ? _vala_array_dup9 (_tmp113_, _tmp113__length1) : _tmp113_;
				_tmp114__length1 = _tmp113__length1;
				sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
				sel = _tmp114_;
				sel_length1 = _tmp114__length1;
				_sel_size_ = sel_length1;
				break;
			}
			case GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNTRACKED:
			{
				GitgCommitSidebarItem** _tmp115_;
				gint _tmp115__length1;
				GitgCommitSidebarItem** _tmp116_;
				gint _tmp116__length1;
				_tmp115_ = current_untracked;
				_tmp115__length1 = current_untracked_length1;
				_tmp116_ = (_tmp115_ != NULL) ? _vala_array_dup10 (_tmp115_, _tmp115__length1) : _tmp115_;
				_tmp116__length1 = _tmp115__length1;
				sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
				sel = _tmp116_;
				sel_length1 = _tmp116__length1;
				_sel_size_ = sel_length1;
				break;
			}
			case GITG_COMMIT_SIDEBAR_ITEM_TYPE_SUBMODULE:
			{
				GitgCommitSidebarItem** _tmp117_;
				gint _tmp117__length1;
				GitgCommitSidebarItem** _tmp118_;
				gint _tmp118__length1;
				_tmp117_ = current_submodules;
				_tmp117__length1 = current_submodules_length1;
				_tmp118_ = (_tmp117_ != NULL) ? _vala_array_dup11 (_tmp117_, _tmp117__length1) : _tmp117_;
				_tmp118__length1 = _tmp117__length1;
				sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
				sel = _tmp118_;
				sel_length1 = _tmp118__length1;
				_sel_size_ = sel_length1;
				break;
			}
			default:
			break;
		}
		_tmp120_ = sel;
		_tmp120__length1 = sel_length1;
		if (_tmp120_ == NULL) {
			_tmp119_ = TRUE;
		} else {
			GitgCommitSidebarItem** _tmp121_;
			gint _tmp121__length1;
			_tmp121_ = sel;
			_tmp121__length1 = sel_length1;
			_tmp119_ = _tmp121__length1 == 0;
		}
		if (_tmp119_) {
			GitgCommitSidebarItem** _tmp122_;
			gint _tmp122__length1;
			GitgCommitSidebarItem** _tmp123_;
			gint _tmp123__length1;
			_tmp122_ = current_staged;
			_tmp122__length1 = current_staged_length1;
			_tmp123_ = (_tmp122_ != NULL) ? _vala_array_dup12 (_tmp122_, _tmp122__length1) : _tmp122_;
			_tmp123__length1 = _tmp122__length1;
			sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
			sel = _tmp123_;
			sel_length1 = _tmp123__length1;
			_sel_size_ = sel_length1;
		}
		_tmp125_ = sel;
		_tmp125__length1 = sel_length1;
		if (_tmp125_ == NULL) {
			_tmp124_ = TRUE;
		} else {
			GitgCommitSidebarItem** _tmp126_;
			gint _tmp126__length1;
			_tmp126_ = sel;
			_tmp126__length1 = sel_length1;
			_tmp124_ = _tmp126__length1 == 0;
		}
		if (_tmp124_) {
			GitgCommitSidebarItem** _tmp127_;
			gint _tmp127__length1;
			GitgCommitSidebarItem** _tmp128_;
			gint _tmp128__length1;
			_tmp127_ = current_unstaged;
			_tmp127__length1 = current_unstaged_length1;
			_tmp128_ = (_tmp127_ != NULL) ? _vala_array_dup13 (_tmp127_, _tmp127__length1) : _tmp127_;
			_tmp128__length1 = _tmp127__length1;
			sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
			sel = _tmp128_;
			sel_length1 = _tmp128__length1;
			_sel_size_ = sel_length1;
		}
		_tmp130_ = sel;
		_tmp130__length1 = sel_length1;
		if (_tmp130_ == NULL) {
			_tmp129_ = TRUE;
		} else {
			GitgCommitSidebarItem** _tmp131_;
			gint _tmp131__length1;
			_tmp131_ = sel;
			_tmp131__length1 = sel_length1;
			_tmp129_ = _tmp131__length1 == 0;
		}
		if (_tmp129_) {
			GitgCommitSidebarItem** _tmp132_;
			gint _tmp132__length1;
			GitgCommitSidebarItem** _tmp133_;
			gint _tmp133__length1;
			_tmp132_ = current_untracked;
			_tmp132__length1 = current_untracked_length1;
			_tmp133_ = (_tmp132_ != NULL) ? _vala_array_dup14 (_tmp132_, _tmp132__length1) : _tmp132_;
			_tmp133__length1 = _tmp132__length1;
			sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
			sel = _tmp133_;
			sel_length1 = _tmp133__length1;
			_sel_size_ = sel_length1;
		}
		_tmp135_ = sel;
		_tmp135__length1 = sel_length1;
		if (_tmp135_ == NULL) {
			_tmp134_ = TRUE;
		} else {
			GitgCommitSidebarItem** _tmp136_;
			gint _tmp136__length1;
			_tmp136_ = sel;
			_tmp136__length1 = sel_length1;
			_tmp134_ = _tmp136__length1 == 0;
		}
		if (_tmp134_) {
			GitgCommitSidebarItem** _tmp137_;
			gint _tmp137__length1;
			GitgCommitSidebarItem** _tmp138_;
			gint _tmp138__length1;
			_tmp137_ = current_submodules;
			_tmp137__length1 = current_submodules_length1;
			_tmp138_ = (_tmp137_ != NULL) ? _vala_array_dup15 (_tmp137_, _tmp137__length1) : _tmp137_;
			_tmp138__length1 = _tmp137__length1;
			sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
			sel = _tmp138_;
			sel_length1 = _tmp138__length1;
			_sel_size_ = sel_length1;
		}
		_tmp140_ = sel;
		_tmp140__length1 = sel_length1;
		if (_tmp140_ != NULL) {
			GitgCommitSidebarItem** _tmp141_;
			gint _tmp141__length1;
			_tmp141_ = sel;
			_tmp141__length1 = sel_length1;
			_tmp139_ = _tmp141__length1 != 0;
		} else {
			_tmp139_ = FALSE;
		}
		if (_tmp139_) {
			GitgCommitSidebarItem** _tmp142_;
			gint _tmp142__length1;
			_tmp142_ = sel;
			_tmp142__length1 = sel_length1;
			{
				GitgCommitSidebarItem** item_collection = NULL;
				gint item_collection_length1 = 0;
				gint _item_collection_size_ = 0;
				gint item_it = 0;
				item_collection = _tmp142_;
				item_collection_length1 = _tmp142__length1;
				for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) {
					GitgCommitSidebarItem* _tmp143_;
					GitgCommitSidebarItem* item = NULL;
					_tmp143_ = _g_object_ref0 (item_collection[item_it]);
					item = _tmp143_;
					{
						GitgCommitPaned* _tmp144_;
						GitgCommitSidebar* _tmp145_;
						GitgCommitSidebar* _tmp146_;
						GitgCommitSidebarItem* _tmp147_;
						_tmp144_ = self->priv->d_main;
						_tmp145_ = gitg_commit_paned_get_sidebar (_tmp144_);
						_tmp146_ = _tmp145_;
						_tmp147_ = item;
						gitg_sidebar_select ((GitgSidebar*) _tmp146_, (GitgSidebarItem*) _tmp147_);
						_g_object_unref0 (item);
					}
				}
			}
		} else {
			if (_data23_->selected_type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_STAGED) {
				GitgCommitPaned* _tmp148_;
				GitgCommitSidebar* _tmp149_;
				GitgCommitSidebar* _tmp150_;
				GitgSidebarStoreSidebarHeader* _tmp151_;
				_tmp148_ = self->priv->d_main;
				_tmp149_ = gitg_commit_paned_get_sidebar (_tmp148_);
				_tmp150_ = _tmp149_;
				_tmp151_ = staged_header;
				gitg_sidebar_select ((GitgSidebar*) _tmp150_, (GitgSidebarItem*) _tmp151_);
			} else {
				GitgCommitPaned* _tmp152_;
				GitgCommitSidebar* _tmp153_;
				GitgCommitSidebar* _tmp154_;
				GitgSidebarStoreSidebarHeader* _tmp155_;
				_tmp152_ = self->priv->d_main;
				_tmp153_ = gitg_commit_paned_get_sidebar (_tmp152_);
				_tmp154_ = _tmp153_;
				_tmp155_ = unstaged_header;
				gitg_sidebar_select ((GitgSidebar*) _tmp154_, (GitgSidebarItem*) _tmp155_);
			}
		}
		sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
	} else {
		GitgStageStatusItem** _tmp156_;
		gint _tmp156__length1;
		_tmp156_ = unstaged;
		_tmp156__length1 = unstaged_length1;
		if (_tmp156__length1 == 0) {
			GitgCommitPaned* _tmp157_;
			GitgCommitSidebar* _tmp158_;
			GitgCommitSidebar* _tmp159_;
			GitgSidebarStoreSidebarHeader* _tmp160_;
			_tmp157_ = self->priv->d_main;
			_tmp158_ = gitg_commit_paned_get_sidebar (_tmp157_);
			_tmp159_ = _tmp158_;
			_tmp160_ = staged_header;
			gitg_sidebar_select ((GitgSidebar*) _tmp159_, (GitgSidebarItem*) _tmp160_);
		} else {
			GitgCommitPaned* _tmp161_;
			GitgCommitSidebar* _tmp162_;
			GitgCommitSidebar* _tmp163_;
			GitgSidebarStoreSidebarHeader* _tmp164_;
			_tmp161_ = self->priv->d_main;
			_tmp162_ = gitg_commit_paned_get_sidebar (_tmp161_);
			_tmp163_ = _tmp162_;
			_tmp164_ = unstaged_header;
			gitg_sidebar_select ((GitgSidebar*) _tmp163_, (GitgSidebarItem*) _tmp164_);
		}
	}
	_g_object_unref0 (unstaged_header);
	_g_object_unref0 (staged_header);
	current_submodules = (_vala_array_free (current_submodules, current_submodules_length1, (GDestroyNotify) g_object_unref), NULL);
	current_untracked = (_vala_array_free (current_untracked, current_untracked_length1, (GDestroyNotify) g_object_unref), NULL);
	current_unstaged = (_vala_array_free (current_unstaged, current_unstaged_length1, (GDestroyNotify) g_object_unref), NULL);
	current_staged = (_vala_array_free (current_staged, current_staged_length1, (GDestroyNotify) g_object_unref), NULL);
	dirty = (_vala_array_free (dirty, dirty_length1, (GDestroyNotify) g_object_unref), NULL);
	untracked = (_vala_array_free (untracked, untracked_length1, (GDestroyNotify) g_object_unref), NULL);
	unstaged = (_vala_array_free (unstaged, unstaged_length1, (GDestroyNotify) g_object_unref), NULL);
	staged = (_vala_array_free (staged, staged_length1, (GDestroyNotify) g_object_unref), NULL);
	items = (_vala_array_free (items, items_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
___lambda39__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda39_ (self, source_object, res);
	block23_data_unref (self);
}

static void
_vala_GgitStatusOptions_free (GgitStatusOptions* self)
{
	g_boxed_free (ggit_status_options_get_type (), self);
}

static void
gitg_commit_activity_reload (GitgCommitActivity* self)
{
	Block23Data* _data23_;
	GitgRepository* repository = NULL;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgRepository* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	gboolean _tmp6_ = FALSE;
	GitgRepository* _tmp7_;
	GitgCommitSidebar* sb = NULL;
	GitgCommitPaned* _tmp8_;
	GitgCommitSidebar* _tmp9_;
	GitgCommitSidebar* _tmp10_;
	GitgCommitSidebar* _tmp11_;
	GitgCommitSidebar* _tmp12_;
	GitgSidebarStore* _tmp13_;
	GitgSidebarStore* _tmp14_;
	GitgSidebarStore* _tmp15_;
	GitgStageStatusItem** selected_items = NULL;
	gint selected_items_length1 = 0;
	gint _selected_items_size_ = 0;
	GitgCommitSidebar* _tmp16_;
	gint _tmp17_ = 0;
	gpointer* _tmp18_;
	GitgSidebarItem** _tmp19_;
	gint _tmp19__length1;
	GitgCommitSidebarItemType _tmp20_ = 0;
	gint _tmp21_ = 0;
	GitgStageStatusItem** _tmp22_;
	GeeHashSet* _tmp23_;
	GitgStageStatusItem** _tmp24_;
	gint _tmp24__length1;
	GitgCommitPaned* _tmp31_;
	GitgDiffView* _tmp32_;
	GitgDiffView* _tmp33_;
	gboolean _tmp34_;
	gboolean _tmp35_;
	GitgStage* stage = NULL;
	GitgRepository* _tmp41_;
	GitgStage* _tmp42_;
	GitgStage* _tmp43_;
	GgitStatusOption opts = 0U;
	GgitStatusShow show = 0;
	GgitStatusOptions* options = NULL;
	GgitStatusOptions* _tmp44_;
	GitgStage* _tmp45_;
	GgitStatusOptions* _tmp46_;
	GitgStageStatusEnumerator* _tmp47_;
	GitgStageStatusEnumerator* _tmp48_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_gitg_when_mapped_unref0 (self->priv->d_reload_when_mapped);
	self->priv->d_reload_when_mapped = NULL;
	_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = gitg_ext_application_get_repository (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	repository = _tmp5_;
	_tmp7_ = repository;
	if (_tmp7_ == NULL) {
		_tmp6_ = TRUE;
	} else {
		_tmp6_ = self->priv->d_reloading;
	}
	if (_tmp6_) {
		_g_object_unref0 (repository);
		block23_data_unref (_data23_);
		_data23_ = NULL;
		return;
	}
	self->priv->d_reloading = TRUE;
	_tmp8_ = self->priv->d_main;
	_tmp9_ = gitg_commit_paned_get_sidebar (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = _g_object_ref0 (_tmp10_);
	sb = _tmp11_;
	_tmp12_ = sb;
	_tmp13_ = gitg_sidebar_get_model ((GitgSidebar*) _tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _g_object_ref0 (_tmp14_);
	_data23_->model = _tmp15_;
	_tmp16_ = sb;
	_tmp18_ = gitg_sidebar_get_selected_items ((GitgSidebar*) _tmp16_, GITG_TYPE_SIDEBAR_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, &_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp19__length1 = _tmp17_;
	_tmp22_ = gitg_commit_activity_items_for_items (self, _tmp19_, (gint) _tmp17_, &_tmp20_, &_tmp21_);
	_data23_->selected_type = _tmp20_;
	selected_items = (_vala_array_free (selected_items, selected_items_length1, (GDestroyNotify) g_object_unref), NULL);
	selected_items = _tmp22_;
	selected_items_length1 = _tmp21_;
	_selected_items_size_ = selected_items_length1;
	_tmp19_ = (_vala_array_free (_tmp19_, _tmp19__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp23_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	_data23_->selected_paths = _tmp23_;
	_tmp24_ = selected_items;
	_tmp24__length1 = selected_items_length1;
	{
		GitgStageStatusItem** item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = _tmp24_;
		item_collection_length1 = _tmp24__length1;
		for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) {
			GitgStageStatusItem* _tmp25_;
			GitgStageStatusItem* item = NULL;
			_tmp25_ = _g_object_ref0 (item_collection[item_it]);
			item = _tmp25_;
			{
				GeeHashSet* _tmp26_;
				GitgStageStatusItem* _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				gchar* _tmp30_;
				_tmp26_ = _data23_->selected_paths;
				_tmp27_ = item;
				_tmp28_ = gitg_stage_status_item_get_path (_tmp27_);
				_tmp29_ = _tmp28_;
				_tmp30_ = _tmp29_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp26_, _tmp30_);
				_g_free0 (_tmp30_);
				_g_object_unref0 (item);
			}
		}
	}
	_tmp31_ = self->priv->d_main;
	_tmp32_ = gitg_commit_paned_get_diff_view (_tmp31_);
	_tmp33_ = _tmp32_;
	_tmp34_ = gitg_diff_view_get_use_gravatar (_tmp33_);
	_tmp35_ = _tmp34_;
	if (_tmp35_) {
		{
			Block24Data* _data24_;
			GgitSignature* author = NULL;
			GgitSignature* _tmp36_;
			GitgAvatarCache* _tmp37_;
			GitgAvatarCache* _tmp38_;
			GgitSignature* _tmp39_;
			const gchar* _tmp40_;
			_data24_ = g_slice_new0 (Block24Data);
			_data24_->_ref_count_ = 1;
			_data24_->_data23_ = block23_data_ref (_data23_);
			_tmp36_ = gitg_commit_activity_get_signature (self, "AUTHOR", &_inner_error0_);
			author = _tmp36_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				block24_data_unref (_data24_);
				_data24_ = NULL;
				goto __catch0_g_error;
			}
			_tmp37_ = gitg_avatar_cache_default ();
			_data24_->ac = _tmp37_;
			_tmp38_ = _data24_->ac;
			_tmp39_ = author;
			_tmp40_ = ggit_signature_get_email (_tmp39_);
			gitg_avatar_cache_load (_tmp38_, _tmp40_, 50, NULL, _____lambda38__gasync_ready_callback, block24_data_ref (_data24_));
			_g_object_unref0 (author);
			block24_data_unref (_data24_);
			_data24_ = NULL;
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			selected_items = (_vala_array_free (selected_items, selected_items_length1, (GDestroyNotify) g_object_unref), NULL);
			_g_object_unref0 (sb);
			_g_object_unref0 (repository);
			block23_data_unref (_data23_);
			_data23_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp41_ = repository;
	_tmp42_ = gitg_repository_get_stage (_tmp41_);
	_tmp43_ = _tmp42_;
	stage = _tmp43_;
	opts = (((GGIT_STATUS_OPTION_INCLUDE_UNTRACKED | GGIT_STATUS_OPTION_RECURSE_UNTRACKED_DIRS) | GGIT_STATUS_OPTION_SORT_CASE_INSENSITIVELY) | GGIT_STATUS_OPTION_EXCLUDE_SUBMODULES) | GGIT_STATUS_OPTION_DISABLE_PATHSPEC_MATCH;
	show = GGIT_STATUS_SHOW_INDEX_AND_WORKDIR;
	_tmp44_ = ggit_status_options_new (opts, show, NULL);
	options = _tmp44_;
	_tmp45_ = stage;
	_tmp46_ = options;
	_tmp47_ = gitg_stage_file_status (_tmp45_, _tmp46_);
	_data23_->enumerator = _tmp47_;
	_tmp48_ = _data23_->enumerator;
	gitg_stage_status_enumerator_next_items (_tmp48_, -1, ___lambda39__gasync_ready_callback, block23_data_ref (_data23_));
	__vala_GgitStatusOptions_free0 (options);
	_g_object_unref0 (stage);
	selected_items = (_vala_array_free (selected_items, selected_items_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (sb);
	_g_object_unref0 (repository);
	block23_data_unref (_data23_);
	_data23_ = NULL;
}

static void
gitg_commit_activity_real_activate (GitgExtUIElement* base)
{
	GitgCommitActivity * self;
	self = (GitgCommitActivity*) base;
	gitg_commit_activity_reload (self);
}

static Block25Data*
block25_data_ref (Block25Data* _data25_)
{
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}

static void
block25_data_unref (void * _userdata_)
{
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data25_->self;
		_g_object_unref0 (_data25_->stage);
		_g_object_unref0 (_data25_->dlg);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}

static void
__lambda53_ (Block25Data* _data25_,
             GObject* obj,
             GAsyncResult* res)
{
	GitgCommitActivity* self;
	GError* _inner_error0_ = NULL;
	self = _data25_->self;
	g_return_if_fail (res != NULL);
	{
		GitgStage* _tmp0_;
		GgitOId* _tmp1_;
		GgitOId* _tmp2_;
		GitgExtApplication* _tmp3_;
		GitgExtApplication* _tmp4_;
		GitgExtApplication* _tmp5_;
		_tmp0_ = _data25_->stage;
		_tmp1_ = gitg_stage_commit_finish (_tmp0_, res, &_inner_error0_);
		_tmp2_ = _tmp1_;
		__vala_GgitOId_free0 (_tmp2_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		gitg_commit_activity_reload (self);
		_tmp3_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		g_signal_emit_by_name (_tmp5_, "repository-commits-changed");
		_g_object_unref0 (_tmp5_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		gchar* msg = NULL;
		gchar* _tmp6_;
		GitgExtApplication* _tmp7_;
		GitgExtApplication* _tmp8_;
		GitgExtApplication* _tmp9_;
		const gchar* _tmp10_;
		GError* _tmp11_;
		const gchar* _tmp12_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = g_strdup (_ ("Failed to commit"));
		msg = _tmp6_;
		_tmp7_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = msg;
		_tmp11_ = e;
		_tmp12_ = _tmp11_->message;
		gitg_ext_application_show_infobar (_tmp9_, _tmp10_, _tmp12_, GTK_MESSAGE_ERROR);
		_g_object_unref0 (_tmp9_);
		_g_free0 (msg);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	gtk_widget_destroy ((GtkWidget*) _data25_->dlg);
}

static void
___lambda53__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda53_ (self, source_object, res);
	block25_data_unref (self);
}

static void
gitg_commit_activity_do_commit (GitgCommitActivity* self,
                                GitgCommitDialog* dlg,
                                gboolean skip_hooks,
                                GgitSignature* author,
                                GgitSignature* committer)
{
	Block25Data* _data25_;
	GitgCommitDialog* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgRepository* _tmp6_;
	GitgStage* _tmp7_;
	GitgStage* _tmp8_;
	GitgStage* _tmp9_;
	GitgStageCommitOptions opts = 0U;
	gboolean _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	GitgStage* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dlg != NULL);
	g_return_if_fail (author != NULL);
	g_return_if_fail (committer != NULL);
	_data25_ = g_slice_new0 (Block25Data);
	_data25_->_ref_count_ = 1;
	_data25_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (dlg);
	_g_object_unref0 (_data25_->dlg);
	_data25_->dlg = _tmp0_;
	_tmp1_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = gitg_ext_application_get_repository (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = gitg_repository_get_stage (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_;
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (_tmp3_);
	_data25_->stage = _tmp9_;
	opts = 0;
	_tmp10_ = gitg_commit_dialog_get_amend (_data25_->dlg);
	_tmp11_ = _tmp10_;
	if (_tmp11_) {
		opts |= GITG_STAGE_COMMIT_OPTIONS_AMEND;
	} else {
		if (!self->priv->d_has_staged) {
			gitg_commit_dialog_show_infobar (_data25_->dlg, _ ("There are no changes to be committed"), _ ("Use amend to change the commit message of the previous commit"), GTK_MESSAGE_WARNING);
			block25_data_unref (_data25_);
			_data25_ = NULL;
			return;
		}
	}
	_tmp12_ = gitg_commit_dialog_get_sign_off (_data25_->dlg);
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		opts |= GITG_STAGE_COMMIT_OPTIONS_SIGN_OFF;
	}
	_tmp14_ = gitg_commit_dialog_get_sign_commit (_data25_->dlg);
	_tmp15_ = _tmp14_;
	if (_tmp15_) {
		opts |= GITG_STAGE_COMMIT_OPTIONS_SIGN_COMMIT;
	}
	if (skip_hooks) {
		opts |= GITG_STAGE_COMMIT_OPTIONS_SKIP_HOOKS;
	}
	self->priv->d_ignore_external_changes = TRUE;
	_tmp16_ = _data25_->stage;
	_tmp17_ = gitg_commit_dialog_get_pretty_message (_data25_->dlg);
	_tmp18_ = _tmp17_;
	_tmp19_ = _tmp18_;
	gitg_stage_commit (_tmp16_, _tmp19_, author, committer, opts, ___lambda53__gasync_ready_callback, block25_data_ref (_data25_));
	_g_free0 (_tmp19_);
	block25_data_unref (_data25_);
	_data25_ = NULL;
}

static void
gitg_commit_activity_pre_commit_data_free (gpointer _data)
{
	GitgCommitActivityPreCommitData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->author);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityPreCommitData, _data_);
}

static void
gitg_commit_activity_pre_commit (GitgCommitActivity* self,
                                 GgitSignature* author,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	GitgCommitActivityPreCommitData* _data_;
	GitgCommitActivity* _tmp0_;
	GgitSignature* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (author != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityPreCommitData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_pre_commit_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (author);
	_g_object_unref0 (_data_->author);
	_data_->author = _tmp1_;
	gitg_commit_activity_pre_commit_co (_data_);
}

static gboolean
gitg_commit_activity_pre_commit_finish (GitgCommitActivity* self,
                                        GAsyncResult* _res_)
{
	gboolean result;
	GitgCommitActivityPreCommitData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
gitg_commit_activity_pre_commit_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	GitgCommitActivityPreCommitData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_pre_commit_co (_data_);
}

static gboolean
gitg_commit_activity_pre_commit_co (GitgCommitActivityPreCommitData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
		_data_->_tmp1_ = _data_->_tmp0_;
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = gitg_ext_application_get_repository (_data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = gitg_repository_get_stage (_data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_state_ = 1;
		gitg_stage_pre_commit_hook (_data_->_tmp8_, _data_->author, gitg_commit_activity_pre_commit_ready, _data_);
		return FALSE;
		_state_1:
		gitg_stage_pre_commit_hook_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error0_);
		_g_object_unref0 (_data_->_tmp8_);
		_g_object_unref0 (_data_->_tmp5_);
		_g_object_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == GITG_STAGE_ERROR) {
				goto __catch0_gitg_stage_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	goto __finally0;
	__catch0_gitg_stage_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp9_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = _data_->e;
		_data_->_tmp13_ = _data_->_tmp12_->message;
		gitg_ext_application_show_infobar (_data_->_tmp11_, _ ("Failed to pass pre-commit"), _data_->_tmp13_, GTK_MESSAGE_ERROR);
		_g_object_unref0 (_data_->_tmp11_);
		_data_->result = FALSE;
		_g_error_free0 (_data_->e);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = TRUE;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gitg_commit_activity_index_diff_data_free (gpointer _data)
{
	GitgCommitActivityIndexDiffData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityIndexDiffData, _data_);
}

static void
gitg_commit_activity_index_diff (GitgCommitActivity* self,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	GitgCommitActivityIndexDiffData* _data_;
	GitgCommitActivity* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityIndexDiffData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_index_diff_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gitg_commit_activity_index_diff_co (_data_);
}

static GgitDiff*
gitg_commit_activity_index_diff_finish (GitgCommitActivity* self,
                                        GAsyncResult* _res_)
{
	GgitDiff* result;
	GitgCommitActivityIndexDiffData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block26Data*
block26_data_ref (Block26Data* _data26_)
{
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}

static void
block26_data_unref (void * _userdata_)
{
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data26_->self;
		_g_object_unref0 (_data26_->diff);
		_g_object_unref0 (_data26_->tree);
		_g_object_unref0 (_data26_->repository);
		_g_object_unref0 (_data26_->opts);
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}

static void
gitg_commit_activity_index_diff_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	GitgCommitActivityIndexDiffData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_index_diff_co (_data_);
}

static Block27Data*
block27_data_ref (Block27Data* _data27_)
{
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}

static void
block27_data_unref (void * _userdata_)
{
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data27_->_data26_->self;
		_g_object_unref0 (_data27_->index);
		block26_data_unref (_data27_->_data26_);
		_data27_->_data26_ = NULL;
		g_slice_free (Block27Data, _data27_);
	}
}

static void
___lambda50_ (Block27Data* _data27_,
              GError** error)
{
	Block26Data* _data26_;
	GitgCommitActivity* self;
	GgitDiff* _tmp0_ = NULL;
	GitgRepository* _tmp1_;
	GgitTree* _tmp2_;
	GgitIndex* _tmp3_;
	GgitDiffOptions* _tmp4_;
	GgitDiff* _tmp5_;
	GgitDiff* _tmp6_;
	GError* _inner_error0_ = NULL;
	_data26_ = _data27_->_data26_;
	self = _data26_->self;
	_tmp1_ = _data26_->repository;
	_tmp2_ = _data26_->tree;
	_tmp3_ = _data27_->index;
	_tmp4_ = _data26_->opts;
	_tmp5_ = ggit_diff_new_tree_to_index ((GgitRepository*) _tmp1_, _tmp2_, _tmp3_, _tmp4_, &_inner_error0_);
	_tmp0_ = _tmp5_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp6_ = _tmp0_;
	_tmp0_ = NULL;
	_g_object_unref0 (_data26_->diff);
	_data26_->diff = _tmp6_;
	_g_object_unref0 (_tmp0_);
}

static void
____lambda50__gitg_async_thread_func (gpointer self,
                                      GError** error)
{
	___lambda50_ (self, error);
}

static gboolean
gitg_commit_activity_index_diff_co (GitgCommitActivityIndexDiffData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data26_ = g_slice_new0 (Block26Data);
	_data_->_data26_->_ref_count_ = 1;
	_data_->_data26_->self = g_object_ref (_data_->self);
	_data_->_data26_->_async_data_ = _data_;
	_data_->_tmp0_ = ggit_diff_options_new ();
	_data_->_data26_->opts = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->_data26_->opts;
	ggit_diff_options_set_flags (_data_->_tmp1_, (GGIT_DIFF_INCLUDE_UNTRACKED | GGIT_DIFF_DISABLE_PATHSPEC_MATCH) | GGIT_DIFF_RECURSE_UNTRACKED_DIRS);
	_data_->_tmp2_ = _data_->_data26_->opts;
	ggit_diff_options_set_n_context_lines (_data_->_tmp2_, 3);
	_data_->_tmp3_ = _data_->_data26_->opts;
	ggit_diff_options_set_n_interhunk_lines (_data_->_tmp3_, 3);
	_data_->_tmp4_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = gitg_ext_application_get_repository (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->_tmp8_;
	_g_object_unref0 (_data_->_tmp6_);
	_data_->_data26_->repository = _data_->_tmp9_;
	_data_->_tmp10_ = _data_->_data26_->repository;
	_data_->_tmp11_ = gitg_repository_get_stage (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->stage = _data_->_tmp12_;
	_data_->_data26_->tree = NULL;
	{
		_data_->_tmp14_ = _data_->_data26_->repository;
		_data_->_tmp13_ = ggit_repository_is_empty ((GgitRepository*) _data_->_tmp14_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (!_data_->_tmp13_) {
			_data_->_tmp16_ = _data_->stage;
			_data_->_state_ = 1;
			gitg_stage_get_head_tree (_data_->_tmp16_, gitg_commit_activity_index_diff_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp17_ = gitg_stage_get_head_tree_finish (_data_->_tmp16_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp15_ = _data_->_tmp17_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_tmp18_ = _data_->_tmp15_;
			_data_->_tmp15_ = NULL;
			_g_object_unref0 (_data_->_data26_->tree);
			_data_->_data26_->tree = _data_->_tmp18_;
			_g_object_unref0 (_data_->_tmp15_);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		_data_->result = NULL;
		_g_object_unref0 (_data_->stage);
		block26_data_unref (_data_->_data26_);
		_data_->_data26_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->stage);
		block26_data_unref (_data_->_data26_);
		_data_->_data26_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_data26_->diff = NULL;
	{
		_data_->_data27_ = g_slice_new0 (Block27Data);
		_data_->_data27_->_ref_count_ = 1;
		_data_->_data27_->_data26_ = block26_data_ref (_data_->_data26_);
		_data_->_tmp19_ = _data_->_data26_->repository;
		_data_->_tmp20_ = ggit_repository_get_index ((GgitRepository*) _data_->_tmp19_, &_data_->_inner_error0_);
		_data_->_data27_->index = _data_->_tmp20_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block27_data_unref (_data_->_data27_);
			_data_->_data27_ = NULL;
			goto __catch1_g_error;
		}
		_data_->_state_ = 2;
		gitg_async_thread (____lambda50__gitg_async_thread_func, _data_->_data27_, gitg_commit_activity_index_diff_ready, _data_);
		return FALSE;
		_state_2:
		gitg_async_thread_finish (_data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block27_data_unref (_data_->_data27_);
			_data_->_data27_ = NULL;
			goto __catch1_g_error;
		}
		block27_data_unref (_data_->_data27_);
		_data_->_data27_ = NULL;
	}
	goto __finally1;
	__catch1_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		_data_->result = NULL;
		_g_object_unref0 (_data_->stage);
		block26_data_unref (_data_->_data26_);
		_data_->_data26_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally1:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->stage);
		block26_data_unref (_data_->_data26_);
		_data_->_data26_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp21_ = _data_->_data26_->diff;
	_data_->_tmp22_ = _g_object_ref0 (_data_->_tmp21_);
	_data_->result = _data_->_tmp22_;
	_g_object_unref0 (_data_->stage);
	block26_data_unref (_data_->_data26_);
	_data_->_data26_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block28Data*
block28_data_ref (Block28Data* _data28_)
{
	g_atomic_int_inc (&_data28_->_ref_count_);
	return _data28_;
}

static void
block28_data_unref (void * _userdata_)
{
	Block28Data* _data28_;
	_data28_ = (Block28Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data28_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data28_->self;
		_g_object_unref0 (_data28_->author);
		_g_object_unref0 (_data28_->committer);
		_g_object_unref0 (self);
		g_slice_free (Block28Data, _data28_);
	}
}

static void
__lambda51_ (Block28Data* _data28_,
             GObject* obj,
             GAsyncResult* res)
{
	GitgCommitActivity* self;
	GgitDiff* diff = NULL;
	GgitDiff* _tmp0_;
	self = _data28_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = gitg_commit_activity_index_diff_finish (self, res);
	diff = _tmp0_;
	gitg_commit_activity_run_commit_dialog_with_diff (self, _data28_->skip_hooks, _data28_->author, _data28_->committer, diff);
	_g_object_unref0 (diff);
}

static void
___lambda51__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda51_ (self, source_object, res);
	block28_data_unref (self);
}

static void
gitg_commit_activity_run_commit_dialog (GitgCommitActivity* self,
                                        gboolean skip_hooks,
                                        GgitSignature* author,
                                        GgitSignature* committer)
{
	Block28Data* _data28_;
	GgitSignature* _tmp0_;
	GgitSignature* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (author != NULL);
	g_return_if_fail (committer != NULL);
	_data28_ = g_slice_new0 (Block28Data);
	_data28_->_ref_count_ = 1;
	_data28_->self = g_object_ref (self);
	_data28_->skip_hooks = skip_hooks;
	_tmp0_ = _g_object_ref0 (author);
	_g_object_unref0 (_data28_->author);
	_data28_->author = _tmp0_;
	_tmp1_ = _g_object_ref0 (committer);
	_g_object_unref0 (_data28_->committer);
	_data28_->committer = _tmp1_;
	gitg_commit_activity_index_diff (self, ___lambda51__gasync_ready_callback, block28_data_ref (_data28_));
	block28_data_unref (_data28_);
	_data28_ = NULL;
}

static Block29Data*
block29_data_ref (Block29Data* _data29_)
{
	g_atomic_int_inc (&_data29_->_ref_count_);
	return _data29_;
}

static void
block29_data_unref (void * _userdata_)
{
	Block29Data* _data29_;
	_data29_ = (Block29Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data29_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data29_->self;
		_g_object_unref0 (_data29_->dlg);
		_g_object_unref0 (_data29_->committer);
		_g_object_unref0 (self);
		g_slice_free (Block29Data, _data29_);
	}
}

static void
__lambda52_ (Block29Data* _data29_,
             GtkDialog* d,
             gint id)
{
	GitgCommitActivity* self;
	self = _data29_->self;
	g_return_if_fail (d != NULL);
	if (id == ((gint) GTK_RESPONSE_OK)) {
		GgitSignature* _tmp0_;
		GgitSignature* _tmp1_;
		GgitSignature* _tmp2_;
		_tmp0_ = gitg_commit_dialog_get_author (_data29_->dlg);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		gitg_commit_activity_do_commit (self, _data29_->dlg, _data29_->skip_hooks, _tmp2_, _data29_->committer);
		_g_object_unref0 (_tmp2_);
	} else {
		gtk_widget_destroy ((GtkWidget*) d);
	}
}

static void
___lambda52__gtk_dialog_response (GtkDialog* _sender,
                                  gint response_id,
                                  gpointer self)
{
	__lambda52_ (self, _sender, response_id);
}

static void
gitg_commit_activity_run_commit_dialog_with_diff (GitgCommitActivity* self,
                                                  gboolean skip_hooks,
                                                  GgitSignature* author,
                                                  GgitSignature* committer,
                                                  GgitDiff* diff)
{
	Block29Data* _data29_;
	GgitSignature* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgRepository* _tmp6_;
	GitgCommitDialog* _tmp7_;
	GitgCommitDialog* _tmp8_;
	GitgCommitPaned* _tmp9_;
	GtkWidget* _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (author != NULL);
	g_return_if_fail (committer != NULL);
	_data29_ = g_slice_new0 (Block29Data);
	_data29_->_ref_count_ = 1;
	_data29_->self = g_object_ref (self);
	_data29_->skip_hooks = skip_hooks;
	_tmp0_ = _g_object_ref0 (committer);
	_g_object_unref0 (_data29_->committer);
	_data29_->committer = _tmp0_;
	_tmp1_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = gitg_ext_application_get_repository (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = gitg_commit_dialog_new (_tmp6_, author, diff);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (_tmp3_);
	_data29_->dlg = _tmp8_;
	_tmp9_ = self->priv->d_main;
	_tmp10_ = gtk_widget_get_toplevel ((GtkWidget*) _tmp9_);
	gtk_window_set_transient_for ((GtkWindow*) _data29_->dlg, G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_window_get_type (), GtkWindow));
	gtk_dialog_set_default_response ((GtkDialog*) _data29_->dlg, (gint) GTK_RESPONSE_OK);
	g_signal_connect_data ((GtkDialog*) _data29_->dlg, "response", (GCallback) ___lambda52__gtk_dialog_response, block29_data_ref (_data29_), (GClosureNotify) block29_data_unref, 0);
	gtk_widget_show ((GtkWidget*) _data29_->dlg);
	block29_data_unref (_data29_);
	_data29_ = NULL;
}

static GgitSignature*
gitg_commit_activity_get_signature (GitgCommitActivity* self,
                                    const gchar* envname,
                                    GError** error)
{
	GgitSignature* _tmp0_ = NULL;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgRepository* _tmp6_;
	GitgExtApplication* _tmp7_;
	GitgExtApplication* _tmp8_;
	GitgExtApplication* _tmp9_;
	GeeMap* _tmp10_;
	GeeMap* _tmp11_;
	GeeMap* _tmp12_;
	GgitSignature* _tmp13_;
	GgitSignature* _tmp14_;
	GgitSignature* _tmp15_;
	GError* _inner_error0_ = NULL;
	GgitSignature* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (envname != NULL, NULL);
	_tmp1_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = gitg_ext_application_get_repository (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp10_ = gitg_ext_application_get_environment (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = _tmp11_;
	_tmp13_ = gitg_repository_get_signature_with_environment (_tmp6_, _tmp12_, envname, &_inner_error0_);
	_tmp14_ = _tmp13_;
	_g_object_unref0 (_tmp12_);
	_g_object_unref0 (_tmp9_);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (_tmp3_);
	_tmp0_ = _tmp14_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	}
	_tmp15_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp15_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static Block30Data*
block30_data_ref (Block30Data* _data30_)
{
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}

static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data30_->self;
		_g_object_unref0 (_data30_->author);
		_g_object_unref0 (_data30_->committer);
		_g_object_unref0 (self);
		g_slice_free (Block30Data, _data30_);
	}
}

static void
___lambda54_ (Block30Data* _data30_,
              GObject* obj,
              GAsyncResult* res)
{
	GitgCommitActivity* self;
	GgitSignature* _tmp0_;
	GgitSignature* _tmp1_;
	self = _data30_->self;
	g_return_if_fail (res != NULL);
	if (!gitg_commit_activity_pre_commit_finish (self, res)) {
		return;
	}
	_tmp0_ = _data30_->author;
	_tmp1_ = _data30_->committer;
	gitg_commit_activity_run_commit_dialog (self, FALSE, _tmp0_, _tmp1_);
}

static void
____lambda54__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda54_ (self, source_object, res);
	block30_data_unref (self);
}

static void
gitg_commit_activity_on_commit_clicked (GitgCommitActivity* self)
{
	Block30Data* _data30_;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GgitSignature* _tmp3_;
	GgitSignature* _tmp4_;
	GitgCommitPaned* _tmp23_;
	gboolean _tmp24_;
	gboolean _tmp25_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_data30_ = g_slice_new0 (Block30Data);
	_data30_->_ref_count_ = 1;
	_data30_->self = g_object_ref (self);
	_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = gitg_ext_application_get_verified_committer (_tmp2_);
	_g_object_unref0 (_data30_->committer);
	_data30_->committer = _tmp3_;
	_g_object_unref0 (_tmp2_);
	_tmp4_ = _data30_->committer;
	if (_tmp4_ == NULL) {
		block30_data_unref (_data30_);
		_data30_ = NULL;
		return;
	}
	{
		GgitSignature* _tmp5_ = NULL;
		GitgExtApplication* _tmp6_;
		GitgExtApplication* _tmp7_;
		GitgExtApplication* _tmp8_;
		GitgRepository* _tmp9_;
		GitgRepository* _tmp10_;
		GitgRepository* _tmp11_;
		GitgExtApplication* _tmp12_;
		GitgExtApplication* _tmp13_;
		GitgExtApplication* _tmp14_;
		GeeMap* _tmp15_;
		GeeMap* _tmp16_;
		GeeMap* _tmp17_;
		GgitSignature* _tmp18_;
		GgitSignature* _tmp19_;
		GgitSignature* _tmp20_;
		_tmp6_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = gitg_ext_application_get_repository (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		_tmp12_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp13_ = _tmp12_;
		_tmp14_ = _tmp13_;
		_tmp15_ = gitg_ext_application_get_environment (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = _tmp16_;
		_tmp18_ = gitg_repository_get_signature_with_environment (_tmp11_, _tmp17_, "AUTHOR", &_inner_error0_);
		_tmp19_ = _tmp18_;
		_g_object_unref0 (_tmp17_);
		_g_object_unref0 (_tmp14_);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (_tmp8_);
		_tmp5_ = _tmp19_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp20_ = _tmp5_;
		_tmp5_ = NULL;
		_g_object_unref0 (_data30_->author);
		_data30_->author = _tmp20_;
		_g_object_unref0 (_tmp5_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GgitSignature* _tmp21_;
		GgitSignature* _tmp22_;
		g_clear_error (&_inner_error0_);
		_tmp21_ = _data30_->committer;
		_tmp22_ = _g_object_ref0 (_tmp21_);
		_g_object_unref0 (_data30_->author);
		_data30_->author = _tmp22_;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		block30_data_unref (_data30_);
		_data30_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp23_ = self->priv->d_main;
	_tmp24_ = gitg_commit_paned_get_skip_hooks (_tmp23_);
	_tmp25_ = _tmp24_;
	if (_tmp25_) {
		GgitSignature* _tmp26_;
		GgitSignature* _tmp27_;
		_tmp26_ = _data30_->author;
		_tmp27_ = _data30_->committer;
		gitg_commit_activity_run_commit_dialog (self, TRUE, _tmp26_, _tmp27_);
	} else {
		GgitSignature* _tmp28_;
		_tmp28_ = _data30_->author;
		gitg_commit_activity_pre_commit (self, _tmp28_, ____lambda54__gasync_ready_callback, block30_data_ref (_data30_));
	}
	block30_data_unref (_data30_);
	_data30_ = NULL;
}

static void
gitg_commit_activity_stage_unstage_selection_data_free (gpointer _data)
{
	GitgCommitActivityStageUnstageSelectionData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityStageUnstageSelectionData, _data_);
}

static void
gitg_commit_activity_stage_unstage_selection (GitgCommitActivity* self,
                                              gboolean staging,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	GitgCommitActivityStageUnstageSelectionData* _data_;
	GitgCommitActivity* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityStageUnstageSelectionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_stage_unstage_selection_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->staging = staging;
	gitg_commit_activity_stage_unstage_selection_co (_data_);
}

static void
gitg_commit_activity_stage_unstage_selection_finish (GitgCommitActivity* self,
                                                     GAsyncResult* _res_,
                                                     GError** error)
{
	GitgCommitActivityStageUnstageSelectionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gpointer
_gitg_patch_set_ref0 (gpointer self)
{
	return self ? gitg_patch_set_ref (self) : NULL;
}

static void
gitg_commit_activity_stage_unstage_selection_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	GitgCommitActivityStageUnstageSelectionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_stage_unstage_selection_co (_data_);
}

static gboolean
gitg_commit_activity_stage_unstage_selection_co (GitgCommitActivityStageUnstageSelectionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->d_main;
	_data_->_tmp1_ = gitg_commit_paned_get_diff_view (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = 0;
	_data_->_tmp4_ = gitg_diff_view_get_selection (_data_->_tmp2_, &_data_->_tmp3_);
	_data_->selection = _data_->_tmp4_;
	_data_->selection_length1 = _data_->_tmp3_;
	_data_->_selection_size_ = _data_->selection_length1;
	_data_->_tmp5_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = gitg_ext_application_get_repository (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = gitg_repository_get_stage (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->_tmp12_;
	_g_object_unref0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp7_);
	_data_->stage = _data_->_tmp13_;
	_data_->_tmp14_ = _data_->selection;
	_data_->_tmp14__length1 = _data_->selection_length1;
	{
		_data_->pset_collection_length1 = 0;
		_data_->_pset_collection_size_ = 0;
		_data_->pset_collection = _data_->_tmp14_;
		_data_->pset_collection_length1 = _data_->_tmp14__length1;
		for (_data_->pset_it = 0; _data_->pset_it < _data_->pset_collection_length1; _data_->pset_it = _data_->pset_it + 1) {
			_data_->_tmp15_ = _gitg_patch_set_ref0 (_data_->pset_collection[_data_->pset_it]);
			_data_->pset = _data_->_tmp15_;
			{
				_data_->_tmp16_ = _data_->pset;
				_data_->_tmp17_ = _data_->_tmp16_->patches;
				_data_->_tmp17__length1 = _data_->_tmp16_->patches_length1;
				if (_data_->_tmp17__length1 == 0) {
					_gitg_patch_set_unref0 (_data_->pset);
					continue;
				}
				if (_data_->staging) {
					_data_->_tmp18_ = _data_->stage;
					_data_->_tmp19_ = _data_->pset;
					_data_->_state_ = 1;
					gitg_stage_stage_patch (_data_->_tmp18_, _data_->_tmp19_, gitg_commit_activity_stage_unstage_selection_ready, _data_);
					return FALSE;
					_state_1:
					gitg_stage_stage_patch_finish (_data_->_tmp18_, _data_->_res_, &_data_->_inner_error0_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
						_gitg_patch_set_unref0 (_data_->pset);
						_g_object_unref0 (_data_->stage);
						_data_->selection = (_vala_array_free (_data_->selection, _data_->selection_length1, (GDestroyNotify) gitg_patch_set_unref), NULL);
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
				} else {
					_data_->_tmp20_ = _data_->stage;
					_data_->_tmp21_ = _data_->pset;
					_data_->_state_ = 2;
					gitg_stage_unstage_patch (_data_->_tmp20_, _data_->_tmp21_, gitg_commit_activity_stage_unstage_selection_ready, _data_);
					return FALSE;
					_state_2:
					gitg_stage_unstage_patch_finish (_data_->_tmp20_, _data_->_res_, &_data_->_inner_error0_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
						_gitg_patch_set_unref0 (_data_->pset);
						_g_object_unref0 (_data_->stage);
						_data_->selection = (_vala_array_free (_data_->selection, _data_->selection_length1, (GDestroyNotify) gitg_patch_set_unref), NULL);
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
				}
				_gitg_patch_set_unref0 (_data_->pset);
			}
		}
	}
	_data_->_tmp22_ = _data_->self->priv->d_main;
	_data_->_tmp23_ = gitg_commit_paned_get_diff_view (_data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	gitg_diff_view_clear_selection (_data_->_tmp24_);
	_g_object_unref0 (_data_->stage);
	_data_->selection = (_vala_array_free (_data_->selection, _data_->selection_length1, (GDestroyNotify) gitg_patch_set_unref), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gitg_commit_activity_discard_selection_data_free (gpointer _data)
{
	GitgCommitActivityDiscardSelectionData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityDiscardSelectionData, _data_);
}

static void
gitg_commit_activity_discard_selection (GitgCommitActivity* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	GitgCommitActivityDiscardSelectionData* _data_;
	GitgCommitActivity* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityDiscardSelectionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_discard_selection_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gitg_commit_activity_discard_selection_co (_data_);
}

static void
gitg_commit_activity_discard_selection_finish (GitgCommitActivity* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	GitgCommitActivityDiscardSelectionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
gitg_commit_activity_discard_selection_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	GitgCommitActivityDiscardSelectionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_discard_selection_co (_data_);
}

static gboolean
gitg_commit_activity_discard_selection_co (GitgCommitActivityDiscardSelectionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->d_main;
	_data_->_tmp1_ = gitg_commit_paned_get_diff_view (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = 0;
	_data_->_tmp4_ = gitg_diff_view_get_selection (_data_->_tmp2_, &_data_->_tmp3_);
	_data_->selection = _data_->_tmp4_;
	_data_->selection_length1 = _data_->_tmp3_;
	_data_->_selection_size_ = _data_->selection_length1;
	_data_->_tmp5_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = gitg_ext_application_get_repository (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = gitg_repository_get_stage (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->_tmp12_;
	_g_object_unref0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp7_);
	_data_->stage = _data_->_tmp13_;
	_data_->_tmp14_ = _data_->selection;
	_data_->_tmp14__length1 = _data_->selection_length1;
	{
		_data_->pset_collection_length1 = 0;
		_data_->_pset_collection_size_ = 0;
		_data_->pset_collection = _data_->_tmp14_;
		_data_->pset_collection_length1 = _data_->_tmp14__length1;
		for (_data_->pset_it = 0; _data_->pset_it < _data_->pset_collection_length1; _data_->pset_it = _data_->pset_it + 1) {
			_data_->_tmp15_ = _gitg_patch_set_ref0 (_data_->pset_collection[_data_->pset_it]);
			_data_->pset = _data_->_tmp15_;
			{
				_data_->_tmp16_ = _data_->stage;
				_data_->_tmp17_ = _data_->pset;
				_data_->_state_ = 1;
				gitg_stage_revert_patch (_data_->_tmp16_, _data_->_tmp17_, gitg_commit_activity_discard_selection_ready, _data_);
				return FALSE;
				_state_1:
				gitg_stage_revert_patch_finish (_data_->_tmp16_, _data_->_res_, &_data_->_inner_error0_);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_gitg_patch_set_unref0 (_data_->pset);
					_g_object_unref0 (_data_->stage);
					_data_->selection = (_vala_array_free (_data_->selection, _data_->selection_length1, (GDestroyNotify) gitg_patch_set_unref), NULL);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_gitg_patch_set_unref0 (_data_->pset);
			}
		}
	}
	_g_object_unref0 (_data_->stage);
	_data_->selection = (_vala_array_free (_data_->selection, _data_->selection_length1, (GDestroyNotify) gitg_patch_set_unref), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block31Data*
block31_data_ref (Block31Data* _data31_)
{
	g_atomic_int_inc (&_data31_->_ref_count_);
	return _data31_;
}

static void
block31_data_unref (void * _userdata_)
{
	Block31Data* _data31_;
	_data31_ = (Block31Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data31_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data31_->self;
		_g_object_unref0 (_data31_->q);
		_g_object_unref0 (self);
		g_slice_free (Block31Data, _data31_);
	}
}

static gboolean
__lambda63_ (Block31Data* _data31_,
             GitgExtUserQuery* w,
             GtkResponseType r)
{
	GitgCommitActivity* self;
	gboolean result;
	self = _data31_->self;
	g_return_val_if_fail (w != NULL, FALSE);
	if (r == GTK_RESPONSE_OK) {
		result = gitg_commit_activity_do_discard_selection (self, _data31_->q);
		return result;
	}
	result = TRUE;
	return result;
}

static gboolean
___lambda63__gitg_ext_user_query_response (GitgExtUserQuery* _sender,
                                           GtkResponseType response_type,
                                           gpointer self)
{
	gboolean result;
	result = __lambda63_ (self, _sender, response_type);
	return result;
}

static void
gitg_commit_activity_on_discard_clicked (GitgCommitActivity* self)
{
	Block31Data* _data31_;
	gchar* primary = NULL;
	gchar* _tmp0_;
	gchar* secondary = NULL;
	gchar* _tmp1_;
	GitgExtUserQuery* _tmp2_;
	GitgExtUserQueryResponse* _tmp3_;
	GitgExtUserQueryResponse* _tmp4_;
	GitgExtUserQueryResponse** _tmp5_;
	GitgExtUserQueryResponse** _tmp6_;
	gint _tmp6__length1;
	GitgExtApplication* _tmp7_;
	GitgExtApplication* _tmp8_;
	GitgExtApplication* _tmp9_;
	g_return_if_fail (self != NULL);
	_data31_ = g_slice_new0 (Block31Data);
	_data31_->_ref_count_ = 1;
	_data31_->self = g_object_ref (self);
	_tmp0_ = g_strdup (_ ("Discard changes"));
	primary = _tmp0_;
	_tmp1_ = g_strdup (_ ("Are you sure you want to permanently discard the selected changes?"));
	secondary = _tmp1_;
	_tmp2_ = gitg_ext_user_query_new ();
	_data31_->q = _tmp2_;
	gitg_ext_user_query_set_title (_data31_->q, primary);
	gitg_ext_user_query_set_message (_data31_->q, secondary);
	gitg_ext_user_query_set_message_type (_data31_->q, GTK_MESSAGE_QUESTION);
	_tmp3_ = gitg_ext_user_query_response_new (_ ("_Cancel"), GTK_RESPONSE_CANCEL);
	_tmp4_ = gitg_ext_user_query_response_new (_ ("Discard"), GTK_RESPONSE_OK);
	_tmp5_ = g_new0 (GitgExtUserQueryResponse*, 2 + 1);
	_tmp5_[0] = _tmp3_;
	_tmp5_[1] = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp6__length1 = 2;
	gitg_ext_user_query_set_responses (_data31_->q, _tmp6_, (gint) 2);
	_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_object_unref), NULL);
	gitg_ext_user_query_set_default_response (_data31_->q, GTK_RESPONSE_OK);
	g_signal_connect_data (_data31_->q, "response", (GCallback) ___lambda63__gitg_ext_user_query_response, block31_data_ref (_data31_), (GClosureNotify) block31_data_unref, 0);
	_tmp7_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_;
	gitg_ext_application_user_query (_tmp9_, _data31_->q);
	_g_object_unref0 (_tmp9_);
	_g_free0 (secondary);
	_g_free0 (primary);
	block31_data_unref (_data31_);
	_data31_ = NULL;
}

static Block32Data*
block32_data_ref (Block32Data* _data32_)
{
	g_atomic_int_inc (&_data32_->_ref_count_);
	return _data32_;
}

static void
block32_data_unref (void * _userdata_)
{
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data32_->self;
		_g_object_unref0 (_data32_->q);
		_g_object_unref0 (self);
		g_slice_free (Block32Data, _data32_);
	}
}

static void
__lambda64_ (Block32Data* _data32_,
             GObject* obj,
             GAsyncResult* res)
{
	GitgCommitActivity* self;
	GitgExtApplication* _tmp5_;
	GitgExtApplication* _tmp6_;
	GitgExtApplication* _tmp7_;
	GError* _inner_error0_ = NULL;
	self = _data32_->self;
	g_return_if_fail (res != NULL);
	{
		gitg_commit_activity_discard_selection_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GitgExtApplication* _tmp0_;
		GitgExtApplication* _tmp1_;
		GitgExtApplication* _tmp2_;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		gitg_ext_application_show_infobar (_tmp2_, _ ("Failed to discard selection"), _tmp4_, GTK_MESSAGE_ERROR);
		_g_object_unref0 (_tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	g_signal_emit_by_name (_data32_->q, "quit");
	_tmp5_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	gitg_ext_application_set_busy (_tmp7_, FALSE);
	_g_object_unref0 (_tmp7_);
	gitg_commit_activity_reload (self);
}

static void
___lambda64__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda64_ (self, source_object, res);
	block32_data_unref (self);
}

static gboolean
gitg_commit_activity_do_discard_selection (GitgCommitActivity* self,
                                           GitgExtUserQuery* q)
{
	Block32Data* _data32_;
	GitgExtUserQuery* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (q != NULL, FALSE);
	_data32_ = g_slice_new0 (Block32Data);
	_data32_->_ref_count_ = 1;
	_data32_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (q);
	_g_object_unref0 (_data32_->q);
	_data32_->q = _tmp0_;
	_tmp1_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	gitg_ext_application_set_busy (_tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	self->priv->d_ignore_external_changes = TRUE;
	gitg_commit_activity_discard_selection (self, ___lambda64__gasync_ready_callback, block32_data_ref (_data32_));
	result = FALSE;
	block32_data_unref (_data32_);
	_data32_ = NULL;
	return result;
}

static Block33Data*
block33_data_ref (Block33Data* _data33_)
{
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data33_->self;
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

static void
__lambda65_ (Block33Data* _data33_,
             GObject* obj,
             GAsyncResult* res)
{
	GitgCommitActivity* self;
	GError* _inner_error0_ = NULL;
	self = _data33_->self;
	g_return_if_fail (res != NULL);
	{
		gitg_commit_activity_stage_unstage_selection_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		gchar* msg = NULL;
		GitgExtApplication* _tmp2_;
		GitgExtApplication* _tmp3_;
		GitgExtApplication* _tmp4_;
		const gchar* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		if (_data33_->staging) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (_ ("Failed to stage selection"));
			_g_free0 (msg);
			msg = _tmp0_;
		} else {
			gchar* _tmp1_;
			_tmp1_ = g_strdup (_ ("Failed to unstage selection"));
			_g_free0 (msg);
			msg = _tmp1_;
		}
		_tmp2_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = msg;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		gitg_ext_application_show_infobar (_tmp4_, _tmp5_, _tmp7_, GTK_MESSAGE_ERROR);
		_g_object_unref0 (_tmp4_);
		_g_free0 (msg);
		_g_error_free0 (e);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	gitg_commit_activity_reload (self);
}

static void
___lambda65__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda65_ (self, source_object, res);
	block33_data_unref (self);
}

static void
gitg_commit_activity_on_stage_clicked (GitgCommitActivity* self)
{
	Block33Data* _data33_;
	GitgCommitPaned* _tmp0_;
	GitgDiffView* _tmp1_;
	GitgDiffView* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	_data33_ = g_slice_new0 (Block33Data);
	_data33_->_ref_count_ = 1;
	_data33_->self = g_object_ref (self);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_diff_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gitg_diff_view_get_unstaged (_tmp2_);
	_tmp4_ = _tmp3_;
	_data33_->staging = _tmp4_;
	self->priv->d_ignore_external_changes = TRUE;
	gitg_commit_activity_stage_unstage_selection (self, _data33_->staging, ___lambda65__gasync_ready_callback, block33_data_ref (_data33_));
	block33_data_unref (_data33_);
	_data33_ = NULL;
}

static void
gitg_commit_activity_revert_paths_data_free (gpointer _data)
{
	GitgCommitActivityRevertPathsData* _data_;
	_data_ = _data;
	_data_->paths = (_vala_array_free (_data_->paths, _data_->paths_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityRevertPathsData, _data_);
}

static void
gitg_commit_activity_revert_paths (GitgCommitActivity* self,
                                   gchar** paths,
                                   gint paths_length1,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	GitgCommitActivityRevertPathsData* _data_;
	GitgCommitActivity* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityRevertPathsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_revert_paths_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->paths = (_vala_array_free (_data_->paths, _data_->paths_length1, (GDestroyNotify) g_free), NULL);
	_data_->paths = paths;
	_data_->paths_length1 = paths_length1;
	gitg_commit_activity_revert_paths_co (_data_);
}

static void
gitg_commit_activity_revert_paths_finish (GitgCommitActivity* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	GitgCommitActivityRevertPathsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
gitg_commit_activity_revert_paths_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	GitgCommitActivityRevertPathsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gitg_commit_activity_revert_paths_co (_data_);
}

static gboolean
gitg_commit_activity_revert_paths_co (GitgCommitActivityRevertPathsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = gitg_ext_application_get_repository (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = gitg_repository_get_stage (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_;
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp2_);
	_data_->stage = _data_->_tmp8_;
	{
		_data_->path_collection_length1 = 0;
		_data_->_path_collection_size_ = 0;
		_data_->path_collection = _data_->paths;
		_data_->path_collection_length1 = _data_->paths_length1;
		for (_data_->path_it = 0; _data_->path_it < _data_->path_collection_length1; _data_->path_it = _data_->path_it + 1) {
			_data_->_tmp9_ = g_strdup (_data_->path_collection[_data_->path_it]);
			_data_->path = _data_->_tmp9_;
			{
				_data_->_tmp10_ = _data_->stage;
				_data_->_tmp11_ = _data_->path;
				_data_->_state_ = 1;
				gitg_stage_revert_path (_data_->_tmp10_, _data_->_tmp11_, gitg_commit_activity_revert_paths_ready, _data_);
				return FALSE;
				_state_1:
				gitg_stage_revert_path_finish (_data_->_tmp10_, _data_->_res_, &_data_->_inner_error0_);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_free0 (_data_->path);
					_g_object_unref0 (_data_->stage);
					_data_->paths = (_vala_array_free (_data_->paths, _data_->paths_length1, (GDestroyNotify) g_free), NULL);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_g_free0 (_data_->path);
			}
		}
	}
	_g_object_unref0 (_data_->stage);
	_data_->paths = (_vala_array_free (_data_->paths, _data_->paths_length1, (GDestroyNotify) g_free), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gitg_commit_activity_do_edit_items (GitgCommitActivity* self,
                                    GitgStageStatusItem** items,
                                    gint items_length1)
{
	GtkWindow* window = NULL;
	GitgCommitPaned* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWindow* _tmp2_;
	GFile* root = NULL;
	GitgExtApplication* _tmp3_;
	GitgExtApplication* _tmp4_;
	GitgExtApplication* _tmp5_;
	GitgRepository* _tmp6_;
	GitgRepository* _tmp7_;
	GitgRepository* _tmp8_;
	GFile* _tmp9_;
	GFile* _tmp10_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gtk_widget_get_toplevel ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_window_get_type (), GtkWindow));
	window = _tmp2_;
	_tmp3_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = gitg_ext_application_get_repository (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp9_ = ggit_repository_get_workdir ((GgitRepository*) _tmp8_);
	_tmp10_ = _tmp9_;
	_g_object_unref0 (_tmp8_);
	_g_object_unref0 (_tmp5_);
	root = _tmp10_;
	{
		GitgStageStatusItem** item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = items;
		item_collection_length1 = items_length1;
		for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) {
			GitgStageStatusItem* _tmp11_;
			GitgStageStatusItem* item = NULL;
			_tmp11_ = _g_object_ref0 (item_collection[item_it]);
			item = _tmp11_;
			{
				GFile* file = NULL;
				GFile* _tmp12_;
				GitgStageStatusItem* _tmp13_;
				gchar* _tmp14_;
				gchar* _tmp15_;
				gchar* _tmp16_;
				GFile* _tmp17_;
				GFile* _tmp18_;
				_tmp12_ = root;
				_tmp13_ = item;
				_tmp14_ = gitg_stage_status_item_get_path (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = _tmp15_;
				_tmp17_ = g_file_get_child (_tmp12_, _tmp16_);
				_tmp18_ = _tmp17_;
				_g_free0 (_tmp16_);
				file = _tmp18_;
				{
					GtkWindow* _tmp19_;
					GFile* _tmp20_;
					gchar* _tmp21_;
					gchar* _tmp22_;
					_tmp19_ = window;
					_tmp20_ = file;
					_tmp21_ = g_file_get_uri (_tmp20_);
					_tmp22_ = _tmp21_;
					gtk_show_uri_on_window (_tmp19_, _tmp22_, (guint32) GDK_CURRENT_TIME, &_inner_error0_);
					_g_free0 (_tmp22_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* e = NULL;
					FILE* _tmp23_;
					GitgStageStatusItem* _tmp24_;
					gchar* _tmp25_;
					gchar* _tmp26_;
					gchar* _tmp27_;
					GError* _tmp28_;
					const gchar* _tmp29_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp23_ = stderr;
					_tmp24_ = item;
					_tmp25_ = gitg_stage_status_item_get_path (_tmp24_);
					_tmp26_ = _tmp25_;
					_tmp27_ = _tmp26_;
					_tmp28_ = e;
					_tmp29_ = _tmp28_->message;
					fprintf (_tmp23_, "Failed to launch application for %s: %s\n", _tmp27_, _tmp29_);
					_g_free0 (_tmp27_);
					_g_error_free0 (e);
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (file);
					_g_object_unref0 (item);
					_g_object_unref0 (root);
					_g_object_unref0 (window);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
				_g_object_unref0 (file);
				_g_object_unref0 (item);
			}
		}
	}
	_g_object_unref0 (root);
	_g_object_unref0 (window);
}

static Block34Data*
block34_data_ref (Block34Data* _data34_)
{
	g_atomic_int_inc (&_data34_->_ref_count_);
	return _data34_;
}

static void
block34_data_unref (void * _userdata_)
{
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data34_->self;
		_g_object_unref0 (_data34_->q);
		_g_object_unref0 (self);
		g_slice_free (Block34Data, _data34_);
	}
}

static gchar**
_vala_array_dup16 (gchar** self,
                   gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
__lambda66_ (Block34Data* _data34_,
             GObject* o,
             GAsyncResult* ret)
{
	GitgCommitActivity* self;
	GitgExtApplication* _tmp5_;
	GitgExtApplication* _tmp6_;
	GitgExtApplication* _tmp7_;
	GError* _inner_error0_ = NULL;
	self = _data34_->self;
	g_return_if_fail (ret != NULL);
	{
		gitg_commit_activity_revert_paths_finish (self, ret, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GitgExtApplication* _tmp0_;
		GitgExtApplication* _tmp1_;
		GitgExtApplication* _tmp2_;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		gitg_ext_application_show_infobar (_tmp2_, _ ("Failed to discard changes"), _tmp4_, GTK_MESSAGE_ERROR);
		_g_object_unref0 (_tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp5_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	gitg_ext_application_set_busy (_tmp7_, FALSE);
	_g_object_unref0 (_tmp7_);
	g_signal_emit_by_name (_data34_->q, "quit");
	gitg_commit_activity_reload (self);
}

static void
___lambda66__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda66_ (self, source_object, res);
	block34_data_unref (self);
}

static gboolean
gitg_commit_activity_do_discard_items (GitgCommitActivity* self,
                                       GitgExtUserQuery* q,
                                       GitgStageStatusItem** items,
                                       gint items_length1)
{
	Block34Data* _data34_;
	GitgExtUserQuery* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	gchar** paths = NULL;
	gchar** _tmp4_;
	gint paths_length1;
	gint _paths_size_;
	gchar** _tmp11_;
	gint _tmp11__length1;
	gchar** _tmp12_;
	gint _tmp12__length1;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (q != NULL, FALSE);
	_data34_ = g_slice_new0 (Block34Data);
	_data34_->_ref_count_ = 1;
	_data34_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (q);
	_g_object_unref0 (_data34_->q);
	_data34_->q = _tmp0_;
	_tmp1_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	gitg_ext_application_set_busy (_tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = g_new0 (gchar*, items_length1 + 1);
	paths = _tmp4_;
	paths_length1 = items_length1;
	_paths_size_ = paths_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				gchar** _tmp7_;
				gint _tmp7__length1;
				GitgStageStatusItem* _tmp8_;
				gchar* _tmp9_;
				gchar* _tmp10_;
				if (!_tmp5_) {
					gint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				if (!(i < items_length1)) {
					break;
				}
				_tmp7_ = paths;
				_tmp7__length1 = paths_length1;
				_tmp8_ = items[i];
				_tmp9_ = gitg_stage_status_item_get_path (_tmp8_);
				_tmp10_ = _tmp9_;
				_g_free0 (_tmp7_[i]);
				_tmp7_[i] = _tmp10_;
			}
		}
	}
	self->priv->d_ignore_external_changes = TRUE;
	_tmp11_ = paths;
	_tmp11__length1 = paths_length1;
	_tmp12_ = (_tmp11_ != NULL) ? _vala_array_dup16 (_tmp11_, _tmp11__length1) : _tmp11_;
	_tmp12__length1 = _tmp11__length1;
	gitg_commit_activity_revert_paths (self, _tmp12_, (gint) _tmp12__length1, ___lambda66__gasync_ready_callback, block34_data_ref (_data34_));
	result = FALSE;
	paths = (_vala_array_free (paths, paths_length1, (GDestroyNotify) g_free), NULL);
	block34_data_unref (_data34_);
	_data34_ = NULL;
	return result;
}

static Block35Data*
block35_data_ref (Block35Data* _data35_)
{
	g_atomic_int_inc (&_data35_->_ref_count_);
	return _data35_;
}

static void
block35_data_unref (void * _userdata_)
{
	Block35Data* _data35_;
	_data35_ = (Block35Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data35_->self;
		_g_object_unref0 (_data35_->q);
		_g_object_unref0 (self);
		g_slice_free (Block35Data, _data35_);
	}
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static gboolean
__lambda67_ (Block35Data* _data35_,
             GitgExtUserQuery* w,
             GtkResponseType r)
{
	GitgCommitActivity* self;
	gboolean result;
	self = _data35_->self;
	g_return_val_if_fail (w != NULL, FALSE);
	if (r == GTK_RESPONSE_OK) {
		result = gitg_commit_activity_do_discard_items (self, _data35_->q, _data35_->items, (gint) _data35_->items_length1);
		return result;
	}
	result = TRUE;
	return result;
}

static gboolean
___lambda67__gitg_ext_user_query_response (GitgExtUserQuery* _sender,
                                           GtkResponseType response_type,
                                           gpointer self)
{
	gboolean result;
	result = __lambda67_ (self, _sender, response_type);
	return result;
}

static void
gitg_commit_activity_on_discard_menu_activated (GitgCommitActivity* self,
                                                GitgStageStatusItem** items,
                                                gint items_length1)
{
	Block35Data* _data35_;
	gchar* primary = NULL;
	gchar* _tmp0_;
	gchar* secondary = NULL;
	GitgExtUserQuery* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	GitgExtUserQueryResponse* _tmp27_;
	GitgExtUserQueryResponse* _tmp28_;
	GitgExtUserQueryResponse** _tmp29_;
	GitgExtUserQueryResponse** _tmp30_;
	gint _tmp30__length1;
	GitgExtApplication* _tmp31_;
	GitgExtApplication* _tmp32_;
	GitgExtApplication* _tmp33_;
	g_return_if_fail (self != NULL);
	_data35_ = g_slice_new0 (Block35Data);
	_data35_->_ref_count_ = 1;
	_data35_->self = g_object_ref (self);
	_data35_->items = items;
	_data35_->items_length1 = items_length1;
	_tmp0_ = g_strdup (_ ("Discard changes"));
	primary = _tmp0_;
	if (_data35_->items_length1 == 1) {
		GitgStageStatusItem* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp1_ = _data35_->items[0];
		_tmp2_ = gitg_stage_status_item_get_path (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strdup_printf (_ ("Are you sure you want to permanently discard all changes made to the f" \
"ile “%s”?"), _tmp4_);
		_g_free0 (secondary);
		secondary = _tmp5_;
		_g_free0 (_tmp4_);
	} else {
		gchar** paths = NULL;
		gchar** _tmp6_;
		gint paths_length1;
		gint _paths_size_;
		gchar** _tmp16_;
		gint _tmp16__length1;
		gchar* _tmp17_;
		gchar* _tmp18_;
		GitgStageStatusItem* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		_tmp6_ = g_new0 (gchar*, (_data35_->items_length1 - 1) + 1);
		paths = _tmp6_;
		paths_length1 = _data35_->items_length1 - 1;
		_paths_size_ = paths_length1;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp7_ = FALSE;
				_tmp7_ = TRUE;
				while (TRUE) {
					gchar** _tmp9_;
					gint _tmp9__length1;
					GitgStageStatusItem* _tmp10_;
					gchar* _tmp11_;
					gchar* _tmp12_;
					gchar* _tmp13_;
					const gchar* _tmp14_;
					gchar* _tmp15_;
					if (!_tmp7_) {
						gint _tmp8_;
						_tmp8_ = i;
						i = _tmp8_ + 1;
					}
					_tmp7_ = FALSE;
					if (!(i < (_data35_->items_length1 - 1))) {
						break;
					}
					_tmp9_ = paths;
					_tmp9__length1 = paths_length1;
					_tmp10_ = _data35_->items[i];
					_tmp11_ = gitg_stage_status_item_get_path (_tmp10_);
					_tmp12_ = _tmp11_;
					_tmp13_ = _tmp12_;
					_tmp14_ = string_to_string (_tmp13_);
					_tmp15_ = g_strconcat ("`", _tmp14_, "'", NULL);
					_g_free0 (_tmp9_[i]);
					_tmp9_[i] = _tmp15_;
					_g_free0 (_tmp13_);
				}
			}
		}
		_tmp16_ = paths;
		_tmp16__length1 = paths_length1;
		_tmp17_ = _vala_g_strjoinv (", ", _tmp16_, (gint) _tmp16__length1);
		_tmp18_ = _tmp17_;
		_tmp19_ = _data35_->items[_data35_->items_length1 - 1];
		_tmp20_ = gitg_stage_status_item_get_path (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = _tmp21_;
		_tmp23_ = g_strdup_printf (_ ("Are you sure you want to permanently discard all changes made to the f" \
"iles %s and “%s”?"), _tmp18_, _tmp22_);
		_g_free0 (secondary);
		secondary = _tmp23_;
		_g_free0 (_tmp22_);
		_g_free0 (_tmp18_);
		paths = (_vala_array_free (paths, paths_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp24_ = gitg_ext_user_query_new ();
	_data35_->q = _tmp24_;
	_tmp25_ = primary;
	gitg_ext_user_query_set_title (_data35_->q, _tmp25_);
	_tmp26_ = secondary;
	gitg_ext_user_query_set_message (_data35_->q, _tmp26_);
	gitg_ext_user_query_set_message_type (_data35_->q, GTK_MESSAGE_QUESTION);
	_tmp27_ = gitg_ext_user_query_response_new (_ ("_Cancel"), GTK_RESPONSE_CANCEL);
	_tmp28_ = gitg_ext_user_query_response_new (_ ("Discard"), GTK_RESPONSE_OK);
	_tmp29_ = g_new0 (GitgExtUserQueryResponse*, 2 + 1);
	_tmp29_[0] = _tmp27_;
	_tmp29_[1] = _tmp28_;
	_tmp30_ = _tmp29_;
	_tmp30__length1 = 2;
	gitg_ext_user_query_set_responses (_data35_->q, _tmp30_, (gint) 2);
	_tmp30_ = (_vala_array_free (_tmp30_, _tmp30__length1, (GDestroyNotify) g_object_unref), NULL);
	gitg_ext_user_query_set_default_response (_data35_->q, GTK_RESPONSE_OK);
	g_signal_connect_data (_data35_->q, "response", (GCallback) ___lambda67__gitg_ext_user_query_response, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
	_tmp31_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp32_ = _tmp31_;
	_tmp33_ = _tmp32_;
	gitg_ext_application_user_query (_tmp33_, _data35_->q);
	_g_object_unref0 (_tmp33_);
	_g_free0 (secondary);
	_g_free0 (primary);
	block35_data_unref (_data35_);
	_data35_ = NULL;
}

static void
gitg_commit_activity_delete_files_data_free (gpointer _data)
{
	GitgCommitActivityDeleteFilesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgCommitActivityDeleteFilesData, _data_);
}

static void
gitg_commit_activity_delete_files (GitgCommitActivity* self,
                                   GFile** files,
                                   gint files_length1,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	GitgCommitActivityDeleteFilesData* _data_;
	GitgCommitActivity* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GitgCommitActivityDeleteFilesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_commit_activity_delete_files_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->files = files;
	_data_->files_length1 = files_length1;
	gitg_commit_activity_delete_files_co (_data_);
}

static void
gitg_commit_activity_delete_files_finish (GitgCommitActivity* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	GitgCommitActivityDeleteFilesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static Block36Data*
block36_data_ref (Block36Data* _data36_)
{
	g_atomic_int_inc (&_data36_->_ref_count_);
	return _data36_;
}

static void
block36_data_unref (void * _userdata_)
{
	Block36Data* _data36_;
	_data36_ = (Block36Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data36_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data36_->self;
		_g_error_free0 (_data36_->_error_);
		(_data36_->cb_target_destroy_notify == NULL) ? NULL : (_data36_->cb_target_destroy_notify (_data36_->cb_target), NULL);
		_data36_->cb = NULL;
		_data36_->cb_target = NULL;
		_data36_->cb_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block36Data, _data36_);
	}
}

static gboolean
_gitg_commit_activity_delete_files_co_gsource_func (gpointer self)
{
	gboolean result;
	result = gitg_commit_activity_delete_files_co (self);
	return result;
}

static Block37Data*
block37_data_ref (Block37Data* _data37_)
{
	g_atomic_int_inc (&_data37_->_ref_count_);
	return _data37_;
}

static void
block37_data_unref (void * _userdata_)
{
	Block37Data* _data37_;
	_data37_ = (Block37Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data37_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data37_->_data36_->self;
		_g_object_unref0 (_data37_->file);
		block36_data_unref (_data37_->_data36_);
		_data37_->_data36_ = NULL;
		g_slice_free (Block37Data, _data37_);
	}
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static void
_____lambda68_ (Block37Data* _data37_,
                GObject* o,
                GAsyncResult* res)
{
	Block36Data* _data36_;
	GitgCommitActivity* self;
	gint _tmp3_;
	GError* _inner_error0_ = NULL;
	_data36_ = _data37_->_data36_;
	self = _data36_->self;
	g_return_if_fail (res != NULL);
	{
		GFile* _tmp0_;
		_tmp0_ = _data37_->file;
		g_file_delete_finish (_tmp0_, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		GError* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _g_error_copy0 (_tmp1_);
		_g_error_free0 (_data36_->_error_);
		_data36_->_error_ = _tmp2_;
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_data36_->n = _data36_->n - 1;
	_tmp3_ = _data36_->n;
	if (_tmp3_ == 0) {
		GSourceFunc _tmp4_;
		gpointer _tmp4__target;
		_tmp4_ = _data36_->cb;
		_tmp4__target = _data36_->cb_target;
		_tmp4_ (_tmp4__target);
	}
}

static void
______lambda68__gasync_ready_callback (GObject* source_object,
                                       GAsyncResult* res,
                                       gpointer self)
{
	_____lambda68_ (self, source_object, res);
	block37_data_unref (self);
}

static gboolean
gitg_commit_activity_delete_files_co (GitgCommitActivityDeleteFilesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data36_ = g_slice_new0 (Block36Data);
	_data_->_data36_->_ref_count_ = 1;
	_data_->_data36_->self = g_object_ref (_data_->self);
	_data_->_data36_->_async_data_ = _data_;
	_data_->_data36_->cb = _gitg_commit_activity_delete_files_co_gsource_func;
	_data_->_data36_->cb_target = _data_;
	_data_->_data36_->cb_target_destroy_notify = NULL;
	_data_->_data36_->_error_ = NULL;
	_data_->_data36_->n = _data_->files_length1;
	{
		_data_->i = 0;
		{
			_data_->_tmp0_ = TRUE;
			while (TRUE) {
				_data_->_data37_ = g_slice_new0 (Block37Data);
				_data_->_data37_->_ref_count_ = 1;
				_data_->_data37_->_data36_ = block36_data_ref (_data_->_data36_);
				if (!_data_->_tmp0_) {
					_data_->_tmp1_ = _data_->i;
					_data_->i = _data_->_tmp1_ + 1;
				}
				_data_->_tmp0_ = FALSE;
				if (!(_data_->i < _data_->files_length1)) {
					block37_data_unref (_data_->_data37_);
					_data_->_data37_ = NULL;
					break;
				}
				_data_->_tmp2_ = _data_->files[_data_->i];
				_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
				_data_->_data37_->file = _data_->_tmp3_;
				_data_->_tmp4_ = _data_->_data37_->file;
				g_file_delete_async (_data_->_tmp4_, G_PRIORITY_DEFAULT, NULL, ______lambda68__gasync_ready_callback, block37_data_ref (_data_->_data37_));
				block37_data_unref (_data_->_data37_);
				_data_->_data37_ = NULL;
			}
		}
	}
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp5_ = _data_->_data36_->_error_;
	if (_data_->_tmp5_ != NULL) {
		_data_->_tmp6_ = _data_->_data36_->_error_;
		_data_->_tmp7_ = _g_error_copy0 (_data_->_tmp6_);
		_data_->_inner_error0_ = _data_->_tmp7_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		block36_data_unref (_data_->_data36_);
		_data_->_data36_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	block36_data_unref (_data_->_data36_);
	_data_->_data36_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block38Data*
block38_data_ref (Block38Data* _data38_)
{
	g_atomic_int_inc (&_data38_->_ref_count_);
	return _data38_;
}

static void
block38_data_unref (void * _userdata_)
{
	Block38Data* _data38_;
	_data38_ = (Block38Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data38_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data38_->self;
		_g_object_unref0 (_data38_->q);
		_g_object_unref0 (self);
		g_slice_free (Block38Data, _data38_);
	}
}

static void
__lambda69_ (Block38Data* _data38_,
             GObject* o,
             GAsyncResult* ret)
{
	GitgCommitActivity* self;
	GitgExtApplication* _tmp5_;
	GitgExtApplication* _tmp6_;
	GitgExtApplication* _tmp7_;
	GError* _inner_error0_ = NULL;
	self = _data38_->self;
	g_return_if_fail (ret != NULL);
	{
		gitg_commit_activity_delete_files_finish (self, ret, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GitgExtApplication* _tmp0_;
		GitgExtApplication* _tmp1_;
		GitgExtApplication* _tmp2_;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		gitg_ext_application_show_infobar (_tmp2_, _ ("Failed to delete files"), _tmp4_, GTK_MESSAGE_ERROR);
		_g_object_unref0 (_tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp5_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	gitg_ext_application_set_busy (_tmp7_, FALSE);
	_g_object_unref0 (_tmp7_);
	g_signal_emit_by_name (_data38_->q, "quit");
	gitg_commit_activity_reload (self);
}

static void
___lambda69__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda69_ (self, source_object, res);
	block38_data_unref (self);
}

static gboolean
gitg_commit_activity_do_delete_items (GitgCommitActivity* self,
                                      GitgExtUserQuery* q,
                                      GitgStageStatusItem** items,
                                      gint items_length1)
{
	Block38Data* _data38_;
	GitgExtUserQuery* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	GFile** files = NULL;
	GFile** _tmp4_;
	gint files_length1;
	gint _files_size_;
	GFile** _tmp21_;
	gint _tmp21__length1;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (q != NULL, FALSE);
	_data38_ = g_slice_new0 (Block38Data);
	_data38_->_ref_count_ = 1;
	_data38_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (q);
	_g_object_unref0 (_data38_->q);
	_data38_->q = _tmp0_;
	_tmp1_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	gitg_ext_application_set_busy (_tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = g_new0 (GFile*, items_length1 + 1);
	files = _tmp4_;
	files_length1 = items_length1;
	_files_size_ = files_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				GFile** _tmp7_;
				gint _tmp7__length1;
				GitgExtApplication* _tmp8_;
				GitgExtApplication* _tmp9_;
				GitgExtApplication* _tmp10_;
				GitgRepository* _tmp11_;
				GitgRepository* _tmp12_;
				GitgRepository* _tmp13_;
				GFile* _tmp14_;
				GFile* _tmp15_;
				GitgStageStatusItem* _tmp16_;
				gchar* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
				GFile* _tmp20_;
				if (!_tmp5_) {
					gint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				if (!(i < items_length1)) {
					break;
				}
				_tmp7_ = files;
				_tmp7__length1 = files_length1;
				_tmp8_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
				_tmp9_ = _tmp8_;
				_tmp10_ = _tmp9_;
				_tmp11_ = gitg_ext_application_get_repository (_tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp14_ = ggit_repository_get_workdir ((GgitRepository*) _tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = items[i];
				_tmp17_ = gitg_stage_status_item_get_path (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = _tmp18_;
				_tmp20_ = g_file_get_child (_tmp15_, _tmp19_);
				_g_object_unref0 (_tmp7_[i]);
				_tmp7_[i] = _tmp20_;
				_g_free0 (_tmp19_);
				_g_object_unref0 (_tmp15_);
				_g_object_unref0 (_tmp13_);
				_g_object_unref0 (_tmp10_);
			}
		}
	}
	self->priv->d_ignore_external_changes = TRUE;
	_tmp21_ = files;
	_tmp21__length1 = files_length1;
	gitg_commit_activity_delete_files (self, _tmp21_, (gint) _tmp21__length1, ___lambda69__gasync_ready_callback, block38_data_ref (_data38_));
	result = FALSE;
	files = (_vala_array_free (files, files_length1, (GDestroyNotify) g_object_unref), NULL);
	block38_data_unref (_data38_);
	_data38_ = NULL;
	return result;
}

static Block39Data*
block39_data_ref (Block39Data* _data39_)
{
	g_atomic_int_inc (&_data39_->_ref_count_);
	return _data39_;
}

static void
block39_data_unref (void * _userdata_)
{
	Block39Data* _data39_;
	_data39_ = (Block39Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data39_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data39_->self;
		_g_object_unref0 (_data39_->q);
		_g_object_unref0 (self);
		g_slice_free (Block39Data, _data39_);
	}
}

static gboolean
__lambda70_ (Block39Data* _data39_,
             GitgExtUserQuery* w,
             GtkResponseType r)
{
	GitgCommitActivity* self;
	gboolean result;
	self = _data39_->self;
	g_return_val_if_fail (w != NULL, FALSE);
	if (r == GTK_RESPONSE_OK) {
		result = gitg_commit_activity_do_delete_items (self, _data39_->q, _data39_->items, (gint) _data39_->items_length1);
		return result;
	}
	result = TRUE;
	return result;
}

static gboolean
___lambda70__gitg_ext_user_query_response (GitgExtUserQuery* _sender,
                                           GtkResponseType response_type,
                                           gpointer self)
{
	gboolean result;
	result = __lambda70_ (self, _sender, response_type);
	return result;
}

static void
gitg_commit_activity_on_delete_menu_activated (GitgCommitActivity* self,
                                               GitgStageStatusItem** items,
                                               gint items_length1)
{
	Block39Data* _data39_;
	gchar* primary = NULL;
	gchar* _tmp0_;
	gchar* secondary = NULL;
	GitgExtUserQuery* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	GitgExtUserQueryResponse* _tmp27_;
	const gchar* _tmp28_;
	GitgExtUserQueryResponse* _tmp29_;
	GitgExtUserQueryResponse** _tmp30_;
	GitgExtUserQueryResponse** _tmp31_;
	gint _tmp31__length1;
	GitgExtApplication* _tmp32_;
	GitgExtApplication* _tmp33_;
	GitgExtApplication* _tmp34_;
	g_return_if_fail (self != NULL);
	_data39_ = g_slice_new0 (Block39Data);
	_data39_->_ref_count_ = 1;
	_data39_->self = g_object_ref (self);
	_data39_->items = items;
	_data39_->items_length1 = items_length1;
	_tmp0_ = g_strdup (g_dngettext (NULL, "Delete file", "Delete files", (gulong) _data39_->items_length1));
	primary = _tmp0_;
	if (_data39_->items_length1 == 1) {
		GitgStageStatusItem* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp1_ = _data39_->items[0];
		_tmp2_ = gitg_stage_status_item_get_path (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strdup_printf (_ ("Are you sure you want to permanently delete the file “%s”?"), _tmp4_);
		_g_free0 (secondary);
		secondary = _tmp5_;
		_g_free0 (_tmp4_);
	} else {
		gchar** paths = NULL;
		gchar** _tmp6_;
		gint paths_length1;
		gint _paths_size_;
		gchar** _tmp16_;
		gint _tmp16__length1;
		gchar* _tmp17_;
		gchar* _tmp18_;
		GitgStageStatusItem* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		_tmp6_ = g_new0 (gchar*, (_data39_->items_length1 - 1) + 1);
		paths = _tmp6_;
		paths_length1 = _data39_->items_length1 - 1;
		_paths_size_ = paths_length1;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp7_ = FALSE;
				_tmp7_ = TRUE;
				while (TRUE) {
					gchar** _tmp9_;
					gint _tmp9__length1;
					GitgStageStatusItem* _tmp10_;
					gchar* _tmp11_;
					gchar* _tmp12_;
					gchar* _tmp13_;
					const gchar* _tmp14_;
					gchar* _tmp15_;
					if (!_tmp7_) {
						gint _tmp8_;
						_tmp8_ = i;
						i = _tmp8_ + 1;
					}
					_tmp7_ = FALSE;
					if (!(i < (_data39_->items_length1 - 1))) {
						break;
					}
					_tmp9_ = paths;
					_tmp9__length1 = paths_length1;
					_tmp10_ = _data39_->items[i];
					_tmp11_ = gitg_stage_status_item_get_path (_tmp10_);
					_tmp12_ = _tmp11_;
					_tmp13_ = _tmp12_;
					_tmp14_ = string_to_string (_tmp13_);
					_tmp15_ = g_strconcat ("`", _tmp14_, "'", NULL);
					_g_free0 (_tmp9_[i]);
					_tmp9_[i] = _tmp15_;
					_g_free0 (_tmp13_);
				}
			}
		}
		_tmp16_ = paths;
		_tmp16__length1 = paths_length1;
		_tmp17_ = _vala_g_strjoinv (", ", _tmp16_, (gint) _tmp16__length1);
		_tmp18_ = _tmp17_;
		_tmp19_ = _data39_->items[_data39_->items_length1 - 1];
		_tmp20_ = gitg_stage_status_item_get_path (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = _tmp21_;
		_tmp23_ = g_strdup_printf (_ ("Are you sure you want to permanently delete the files %s and “%s”?"), _tmp18_, _tmp22_);
		_g_free0 (secondary);
		secondary = _tmp23_;
		_g_free0 (_tmp22_);
		_g_free0 (_tmp18_);
		paths = (_vala_array_free (paths, paths_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp24_ = gitg_ext_user_query_new ();
	_data39_->q = _tmp24_;
	_tmp25_ = primary;
	gitg_ext_user_query_set_title (_data39_->q, _tmp25_);
	_tmp26_ = secondary;
	gitg_ext_user_query_set_message (_data39_->q, _tmp26_);
	gitg_ext_user_query_set_message_type (_data39_->q, GTK_MESSAGE_QUESTION);
	_tmp27_ = gitg_ext_user_query_response_new (_ ("_Cancel"), GTK_RESPONSE_CANCEL);
	_tmp28_ = primary;
	_tmp29_ = gitg_ext_user_query_response_new (_tmp28_, GTK_RESPONSE_OK);
	_tmp30_ = g_new0 (GitgExtUserQueryResponse*, 2 + 1);
	_tmp30_[0] = _tmp27_;
	_tmp30_[1] = _tmp29_;
	_tmp31_ = _tmp30_;
	_tmp31__length1 = 2;
	gitg_ext_user_query_set_responses (_data39_->q, _tmp31_, (gint) 2);
	_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_object_unref), NULL);
	gitg_ext_user_query_set_default_response (_data39_->q, GTK_RESPONSE_OK);
	gitg_ext_user_query_set_default_is_destructive (_data39_->q, TRUE);
	g_signal_connect_data (_data39_->q, "response", (GCallback) ___lambda70__gitg_ext_user_query_response, block39_data_ref (_data39_), (GClosureNotify) block39_data_unref, 0);
	_tmp32_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp33_ = _tmp32_;
	_tmp34_ = _tmp33_;
	gitg_ext_application_user_query (_tmp34_, _data39_->q);
	_g_object_unref0 (_tmp34_);
	_g_free0 (secondary);
	_g_free0 (primary);
	block39_data_unref (_data39_);
	_data39_ = NULL;
}

static Block40Data*
block40_data_ref (Block40Data* _data40_)
{
	g_atomic_int_inc (&_data40_->_ref_count_);
	return _data40_;
}

static void
block40_data_unref (void * _userdata_)
{
	Block40Data* _data40_;
	_data40_ = (Block40Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data40_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data40_->self;
		_data40_->sitems = (_vala_array_free (_data40_->sitems, _data40_->sitems_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block40Data, _data40_);
	}
}

static void
___lambda71_ (Block40Data* _data40_)
{
	GitgCommitActivity* self;
	GitgStageStatusItem** _tmp0_;
	gint _tmp0__length1;
	self = _data40_->self;
	_tmp0_ = _data40_->sitems;
	_tmp0__length1 = _data40_->sitems_length1;
	gitg_commit_activity_on_unstaged_activated (self, _tmp0_, (gint) _tmp0__length1);
}

static void
____lambda71__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda71_ (self);
}

static void
___lambda72_ (Block40Data* _data40_)
{
	GitgCommitActivity* self;
	GitgStageStatusItem** _tmp0_;
	gint _tmp0__length1;
	self = _data40_->self;
	_tmp0_ = _data40_->sitems;
	_tmp0__length1 = _data40_->sitems_length1;
	gitg_commit_activity_on_staged_activated (self, _tmp0_, (gint) _tmp0__length1);
}

static void
____lambda72__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda72_ (self);
}

static void
___lambda73_ (Block40Data* _data40_)
{
	GitgCommitActivity* self;
	GitgStageStatusItem** _tmp0_;
	gint _tmp0__length1;
	self = _data40_->self;
	_tmp0_ = _data40_->sitems;
	_tmp0__length1 = _data40_->sitems_length1;
	gitg_commit_activity_on_discard_menu_activated (self, _tmp0_, (gint) _tmp0__length1);
}

static void
____lambda73__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda73_ (self);
}

static void
___lambda74_ (Block40Data* _data40_)
{
	GitgCommitActivity* self;
	GitgStageStatusItem** _tmp0_;
	gint _tmp0__length1;
	self = _data40_->self;
	_tmp0_ = _data40_->sitems;
	_tmp0__length1 = _data40_->sitems_length1;
	gitg_commit_activity_on_delete_menu_activated (self, _tmp0_, (gint) _tmp0__length1);
}

static void
____lambda74__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda74_ (self);
}

static void
___lambda75_ (Block40Data* _data40_)
{
	GitgCommitActivity* self;
	GitgStageStatusItem** _tmp0_;
	gint _tmp0__length1;
	self = _data40_->self;
	_tmp0_ = _data40_->sitems;
	_tmp0__length1 = _data40_->sitems_length1;
	gitg_commit_activity_do_edit_items (self, _tmp0_, (gint) _tmp0__length1);
}

static void
____lambda75__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda75_ (self);
}

static void
gitg_commit_activity_do_populate_menu (GitgCommitActivity* self,
                                       GtkMenu* menu)
{
	Block40Data* _data40_;
	GitgSidebarItem** items = NULL;
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	gint _tmp3_ = 0;
	gpointer* _tmp4_;
	gint items_length1;
	gint _items_size_;
	GitgSidebarItem** _tmp5_;
	gint _tmp5__length1;
	GitgCommitSidebarItemType type = 0;
	GitgSidebarItem** _tmp6_;
	gint _tmp6__length1;
	GitgCommitSidebarItemType _tmp7_ = 0;
	gint _tmp8_ = 0;
	GitgStageStatusItem** _tmp9_;
	gboolean hasitems = FALSE;
	GitgStageStatusItem** _tmp10_;
	gint _tmp10__length1;
	gboolean _tmp11_ = FALSE;
	gboolean canedit = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu != NULL);
	_data40_ = g_slice_new0 (Block40Data);
	_data40_->_ref_count_ = 1;
	_data40_->self = g_object_ref (self);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = gitg_sidebar_get_selected_items ((GitgSidebar*) _tmp2_, GITG_TYPE_SIDEBAR_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, &_tmp3_);
	items = _tmp4_;
	items_length1 = _tmp3_;
	_items_size_ = items_length1;
	_tmp5_ = items;
	_tmp5__length1 = items_length1;
	if (_tmp5__length1 == 0) {
		items = (_vala_array_free (items, items_length1, (GDestroyNotify) g_object_unref), NULL);
		block40_data_unref (_data40_);
		_data40_ = NULL;
		return;
	}
	_tmp6_ = items;
	_tmp6__length1 = items_length1;
	_tmp9_ = gitg_commit_activity_items_for_items (self, _tmp6_, (gint) _tmp6__length1, &_tmp7_, &_tmp8_);
	type = _tmp7_;
	_data40_->sitems = _tmp9_;
	_data40_->sitems_length1 = _tmp8_;
	_data40_->_sitems_size_ = _data40_->sitems_length1;
	_tmp10_ = _data40_->sitems;
	_tmp10__length1 = _data40_->sitems_length1;
	hasitems = _tmp10__length1 > 0;
	if (type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNSTAGED) {
		_tmp11_ = TRUE;
	} else {
		_tmp11_ = type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNTRACKED;
	}
	if (_tmp11_) {
		GtkMenuItem* stage = NULL;
		GtkMenuItem* _tmp12_;
		GtkMenuItem* _tmp13_;
		GtkMenuItem* _tmp14_;
		GtkMenuItem* _tmp15_;
		_tmp12_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_Stage changes"));
		g_object_ref_sink (_tmp12_);
		stage = _tmp12_;
		_tmp13_ = stage;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp13_, hasitems);
		_tmp14_ = stage;
		gtk_menu_shell_append ((GtkMenuShell*) menu, _tmp14_);
		_tmp15_ = stage;
		g_signal_connect_data (_tmp15_, "activate", (GCallback) ____lambda71__gtk_menu_item_activate, block40_data_ref (_data40_), (GClosureNotify) block40_data_unref, 0);
		_g_object_unref0 (stage);
	}
	if (type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_STAGED) {
		GtkMenuItem* stage = NULL;
		GtkMenuItem* _tmp16_;
		GtkMenuItem* _tmp17_;
		GtkMenuItem* _tmp18_;
		GtkMenuItem* _tmp19_;
		_tmp16_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_Unstage changes"));
		g_object_ref_sink (_tmp16_);
		stage = _tmp16_;
		_tmp17_ = stage;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp17_, hasitems);
		_tmp18_ = stage;
		gtk_menu_shell_append ((GtkMenuShell*) menu, _tmp18_);
		_tmp19_ = stage;
		g_signal_connect_data (_tmp19_, "activate", (GCallback) ____lambda72__gtk_menu_item_activate, block40_data_ref (_data40_), (GClosureNotify) block40_data_unref, 0);
		_g_object_unref0 (stage);
	}
	if (type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNSTAGED) {
		GtkMenuItem* discard = NULL;
		GtkMenuItem* _tmp20_;
		GtkMenuItem* _tmp21_;
		GtkMenuItem* _tmp22_;
		GtkMenuItem* _tmp23_;
		_tmp20_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_Discard changes"));
		g_object_ref_sink (_tmp20_);
		discard = _tmp20_;
		_tmp21_ = discard;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp21_, hasitems);
		_tmp22_ = discard;
		gtk_menu_shell_append ((GtkMenuShell*) menu, _tmp22_);
		_tmp23_ = discard;
		g_signal_connect_data (_tmp23_, "activate", (GCallback) ____lambda73__gtk_menu_item_activate, block40_data_ref (_data40_), (GClosureNotify) block40_data_unref, 0);
		_g_object_unref0 (discard);
	}
	if (type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNTRACKED) {
		GtkMenuItem* del = NULL;
		GitgStageStatusItem** _tmp24_;
		gint _tmp24__length1;
		GtkMenuItem* _tmp25_;
		GtkMenuItem* _tmp26_;
		GtkMenuItem* _tmp27_;
		GtkMenuItem* _tmp28_;
		_tmp24_ = _data40_->sitems;
		_tmp24__length1 = _data40_->sitems_length1;
		_tmp25_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (g_dngettext (NULL, "D_elete file", "D_elete files", (gulong) _tmp24__length1));
		g_object_ref_sink (_tmp25_);
		del = _tmp25_;
		_tmp26_ = del;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp26_, hasitems);
		_tmp27_ = del;
		gtk_menu_shell_append ((GtkMenuShell*) menu, _tmp27_);
		_tmp28_ = del;
		g_signal_connect_data (_tmp28_, "activate", (GCallback) ____lambda74__gtk_menu_item_activate, block40_data_ref (_data40_), (GClosureNotify) block40_data_unref, 0);
		_g_object_unref0 (del);
	}
	canedit = FALSE;
	if (hasitems) {
		GitgStageStatusItem** _tmp29_;
		gint _tmp29__length1;
		canedit = TRUE;
		_tmp29_ = _data40_->sitems;
		_tmp29__length1 = _data40_->sitems_length1;
		{
			GitgStageStatusItem** item_collection = NULL;
			gint item_collection_length1 = 0;
			gint _item_collection_size_ = 0;
			gint item_it = 0;
			item_collection = _tmp29_;
			item_collection_length1 = _tmp29__length1;
			for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) {
				GitgStageStatusItem* _tmp30_;
				GitgStageStatusItem* item = NULL;
				_tmp30_ = _g_object_ref0 (item_collection[item_it]);
				item = _tmp30_;
				{
					GitgStageStatusFile* file = NULL;
					GitgStageStatusItem* _tmp31_;
					GitgStageStatusFile* _tmp32_;
					gboolean _tmp33_ = FALSE;
					GitgStageStatusFile* _tmp34_;
					_tmp31_ = item;
					_tmp32_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp31_, GITG_TYPE_STAGE_STATUS_FILE) ? ((GitgStageStatusFile*) _tmp31_) : NULL);
					file = _tmp32_;
					_tmp34_ = file;
					if (_tmp34_ == NULL) {
						_tmp33_ = TRUE;
					} else {
						GitgStageStatusFile* _tmp35_;
						GgitStatusFlags _tmp36_;
						GgitStatusFlags _tmp37_;
						_tmp35_ = file;
						_tmp36_ = gitg_stage_status_file_get_flags (_tmp35_);
						_tmp37_ = _tmp36_;
						_tmp33_ = (_tmp37_ & GGIT_STATUS_WORKING_TREE_DELETED) != 0;
					}
					if (_tmp33_) {
						canedit = FALSE;
						_g_object_unref0 (file);
						_g_object_unref0 (item);
						break;
					}
					_g_object_unref0 (file);
					_g_object_unref0 (item);
				}
			}
		}
	}
	if (canedit) {
		GtkMenuItem* edit = NULL;
		GtkMenuItem* _tmp38_;
		GtkMenuItem* _tmp39_;
		GtkMenuItem* _tmp40_;
		_tmp38_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_Edit file"));
		g_object_ref_sink (_tmp38_);
		edit = _tmp38_;
		_tmp39_ = edit;
		gtk_menu_shell_append ((GtkMenuShell*) menu, _tmp39_);
		_tmp40_ = edit;
		g_signal_connect_data (_tmp40_, "activate", (GCallback) ____lambda75__gtk_menu_item_activate, block40_data_ref (_data40_), (GClosureNotify) block40_data_unref, 0);
		_g_object_unref0 (edit);
	}
	items = (_vala_array_free (items, items_length1, (GDestroyNotify) g_object_unref), NULL);
	block40_data_unref (_data40_);
	_data40_ = NULL;
}

static GitgStageStatusItem**
gitg_commit_activity_items_to_stage_items (GitgCommitActivity* self,
                                           GitgCommitSidebarItem** items,
                                           gint items_length1,
                                           gint* result_length1)
{
	GitgStageStatusItem** ret = NULL;
	GitgStageStatusItem** _tmp0_;
	gint ret_length1;
	gint _ret_size_;
	GitgStageStatusItem** _tmp9_;
	gint _tmp9__length1;
	GitgStageStatusItem** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (GitgStageStatusItem*, items_length1 + 1);
	ret = _tmp0_;
	ret_length1 = items_length1;
	_ret_size_ = ret_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GitgStageStatusItem** _tmp3_;
				gint _tmp3__length1;
				GitgStageStatusItem** _tmp4_;
				gint _tmp4__length1;
				GitgCommitSidebarItem* _tmp5_;
				GitgStageStatusItem* _tmp6_;
				GitgStageStatusItem* _tmp7_;
				GitgStageStatusItem* _tmp8_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = ret;
				_tmp3__length1 = ret_length1;
				if (!(i < _tmp3__length1)) {
					break;
				}
				_tmp4_ = ret;
				_tmp4__length1 = ret_length1;
				_tmp5_ = items[i];
				_tmp6_ = gitg_commit_sidebar_item_get_item (_tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = _g_object_ref0 (_tmp7_);
				_g_object_unref0 (_tmp4_[i]);
				_tmp4_[i] = _tmp8_;
			}
		}
	}
	_tmp9_ = ret;
	_tmp9__length1 = ret_length1;
	if (result_length1) {
		*result_length1 = _tmp9__length1;
	}
	result = _tmp9_;
	return result;
}

static GitgStageStatusItem**
gitg_commit_activity_stage_status_items_of_type (GitgCommitActivity* self,
                                                 GitgCommitSidebarItemType type,
                                                 gint* result_length1)
{
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	gint _tmp3_ = 0;
	GitgCommitSidebarItem** _tmp4_;
	GitgCommitSidebarItem** _tmp5_;
	gint _tmp5__length1;
	gint _tmp6_ = 0;
	GitgStageStatusItem** _tmp7_;
	GitgStageStatusItem** _tmp8_;
	gint _tmp8__length1;
	GitgStageStatusItem** _tmp9_;
	gint _tmp9__length1;
	GitgStageStatusItem** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = gitg_commit_sidebar_items_of_type (_tmp2_, type, &_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _tmp3_;
	_tmp7_ = gitg_commit_activity_items_to_stage_items (self, _tmp5_, (gint) _tmp3_, &_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp8__length1 = _tmp6_;
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp9_ = _tmp8_;
	_tmp9__length1 = _tmp8__length1;
	if (result_length1) {
		*result_length1 = _tmp9__length1;
	}
	result = _tmp9_;
	return result;
}

static void
_vala_array_add12 (GitgStageStatusItem** * array,
                   gint* length,
                   gint* size,
                   GitgStageStatusItem* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GitgStageStatusItem*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static GitgStageStatusItem**
gitg_commit_activity_items_for_items (GitgCommitActivity* self,
                                      GitgSidebarItem** items,
                                      gint items_length1,
                                      GitgCommitSidebarItemType* type,
                                      gint* result_length1)
{
	GitgCommitSidebarItemType _vala_type = 0;
	GitgStageStatusItem** ret = NULL;
	GitgStageStatusItem** _tmp0_;
	gint ret_length1;
	gint _ret_size_;
	GitgStageStatusItem** _tmp21_;
	gint _tmp21__length1;
	GitgStageStatusItem** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (GitgStageStatusItem*, items_length1 + 1);
	ret = _tmp0_;
	ret_length1 = items_length1;
	_ret_size_ = ret_length1;
	ret_length1 = 0;
	_vala_type = GITG_COMMIT_SIDEBAR_ITEM_TYPE_NONE;
	{
		GitgSidebarItem** item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = items;
		item_collection_length1 = items_length1;
		for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) {
			GitgSidebarItem* _tmp1_;
			GitgSidebarItem* item = NULL;
			_tmp1_ = _g_object_ref0 (item_collection[item_it]);
			item = _tmp1_;
			{
				GitgSidebarStoreSidebarHeader* header = NULL;
				GitgSidebarItem* _tmp2_;
				GitgSidebarStoreSidebarHeader* _tmp3_;
				GitgSidebarStoreSidebarHeader* _tmp4_;
				GitgCommitSidebarItem* sitem = NULL;
				GitgSidebarItem* _tmp11_;
				GitgCommitSidebarItem* _tmp12_;
				GitgCommitSidebarItem* _tmp13_;
				_tmp2_ = item;
				_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GITG_SIDEBAR_STORE_TYPE_SIDEBAR_HEADER) ? ((GitgSidebarStoreSidebarHeader*) _tmp2_) : NULL);
				header = _tmp3_;
				_tmp4_ = header;
				if (_tmp4_ != NULL) {
					GitgSidebarStoreSidebarHeader* _tmp5_;
					guint _tmp6_;
					guint _tmp7_;
					gint _tmp8_ = 0;
					GitgStageStatusItem** _tmp9_;
					GitgStageStatusItem** _tmp10_;
					gint _tmp10__length1;
					_tmp5_ = header;
					_tmp6_ = gitg_sidebar_store_sidebar_header_get_id (_tmp5_);
					_tmp7_ = _tmp6_;
					_vala_type = (GitgCommitSidebarItemType) _tmp7_;
					_tmp9_ = gitg_commit_activity_stage_status_items_of_type (self, _vala_type, &_tmp8_);
					_tmp10_ = _tmp9_;
					_tmp10__length1 = _tmp8_;
					if (result_length1) {
						*result_length1 = _tmp10__length1;
					}
					result = _tmp10_;
					_g_object_unref0 (header);
					_g_object_unref0 (item);
					ret = (_vala_array_free (ret, ret_length1, (GDestroyNotify) g_object_unref), NULL);
					if (type) {
						*type = _vala_type;
					}
					return result;
				}
				_tmp11_ = item;
				_tmp12_ = _g_object_ref0 (GITG_COMMIT_SIDEBAR_IS_ITEM (_tmp11_) ? ((GitgCommitSidebarItem*) _tmp11_) : NULL);
				sitem = _tmp12_;
				_tmp13_ = sitem;
				if (_tmp13_ != NULL) {
					GitgCommitSidebarItem* _tmp14_;
					GitgStageStatusItem* _tmp15_;
					GitgStageStatusItem* _tmp16_;
					GitgStageStatusItem* _tmp17_;
					GitgCommitSidebarItem* _tmp18_;
					GitgCommitSidebarItemType _tmp19_;
					GitgCommitSidebarItemType _tmp20_;
					_tmp14_ = sitem;
					_tmp15_ = gitg_commit_sidebar_item_get_item (_tmp14_);
					_tmp16_ = _tmp15_;
					_tmp17_ = _g_object_ref0 (_tmp16_);
					_vala_array_add12 (&ret, &ret_length1, &_ret_size_, _tmp17_);
					_tmp18_ = sitem;
					_tmp19_ = gitg_commit_sidebar_item_get_stage_type (_tmp18_);
					_tmp20_ = _tmp19_;
					_vala_type = _tmp20_;
				}
				_g_object_unref0 (sitem);
				_g_object_unref0 (header);
				_g_object_unref0 (item);
			}
		}
	}
	_tmp21_ = ret;
	_tmp21__length1 = ret_length1;
	if (result_length1) {
		*result_length1 = _tmp21__length1;
	}
	result = _tmp21_;
	if (type) {
		*type = _vala_type;
	}
	return result;
}

static void
gitg_commit_activity_sidebar_selection_changed (GitgCommitActivity* self,
                                                GitgSidebarItem** items,
                                                gint items_length1)
{
	GitgCommitSidebarItemType type = 0;
	GitgStageStatusItem** sitems = NULL;
	GitgCommitSidebarItemType _tmp0_ = 0;
	gint _tmp1_ = 0;
	GitgStageStatusItem** _tmp2_;
	gint sitems_length1;
	gint _sitems_size_;
	GitgStageStatusItem** _tmp3_;
	gint _tmp3__length1;
	g_return_if_fail (self != NULL);
	_tmp2_ = gitg_commit_activity_items_for_items (self, items, (gint) items_length1, &_tmp0_, &_tmp1_);
	type = _tmp0_;
	sitems = _tmp2_;
	sitems_length1 = _tmp1_;
	_sitems_size_ = sitems_length1;
	_tmp3_ = sitems;
	_tmp3__length1 = sitems_length1;
	if (_tmp3__length1 == 0) {
		GitgCommitPaned* _tmp4_;
		GitgDiffView* _tmp5_;
		GitgDiffView* _tmp6_;
		gitg_commit_activity_show_ui (self, GITG_COMMIT_ACTIVITY_UI_TYPE_DIFF);
		_tmp4_ = self->priv->d_main;
		_tmp5_ = gitg_commit_paned_get_diff_view (_tmp4_);
		_tmp6_ = _tmp5_;
		gitg_diff_view_set_diff (_tmp6_, NULL);
		sitems = (_vala_array_free (sitems, sitems_length1, (GDestroyNotify) g_object_unref), NULL);
		return;
	}
	if (type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_SUBMODULE) {
		GitgStageStatusItem** _tmp7_;
		gint _tmp7__length1;
		GitgStageStatusItem* _tmp8_;
		_tmp7_ = sitems;
		_tmp7__length1 = sitems_length1;
		_tmp8_ = _tmp7_[0];
		gitg_commit_activity_show_submodule_diff (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GITG_TYPE_STAGE_STATUS_SUBMODULE, GitgStageStatusSubmodule));
	} else {
		if (type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_STAGED) {
			GitgStageStatusItem** _tmp9_;
			gint _tmp9__length1;
			_tmp9_ = sitems;
			_tmp9__length1 = sitems_length1;
			gitg_commit_activity_show_staged_diff (self, _tmp9_, (gint) _tmp9__length1);
		} else {
			GitgStageStatusItem** _tmp10_;
			gint _tmp10__length1;
			_tmp10_ = sitems;
			_tmp10__length1 = sitems_length1;
			gitg_commit_activity_show_unstaged_diff (self, _tmp10_, (gint) _tmp10__length1);
		}
	}
	sitems = (_vala_array_free (sitems, sitems_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
gitg_commit_activity_on_stage_selected_items (GitgCommitActivity* self)
{
	GitgSidebarItem** sel = NULL;
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	gint _tmp3_ = 0;
	gpointer* _tmp4_;
	gint sel_length1;
	gint _sel_size_;
	GitgCommitSidebarItemType type = 0;
	GitgStageStatusItem** sitems = NULL;
	GitgSidebarItem** _tmp5_;
	gint _tmp5__length1;
	GitgCommitSidebarItemType _tmp6_ = 0;
	gint _tmp7_ = 0;
	GitgStageStatusItem** _tmp8_;
	gint sitems_length1;
	gint _sitems_size_;
	gboolean _tmp9_ = FALSE;
	GitgStageStatusItem** _tmp10_;
	gint _tmp10__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = gitg_sidebar_get_selected_items ((GitgSidebar*) _tmp2_, GITG_TYPE_SIDEBAR_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, &_tmp3_);
	sel = _tmp4_;
	sel_length1 = _tmp3_;
	_sel_size_ = sel_length1;
	_tmp5_ = sel;
	_tmp5__length1 = sel_length1;
	_tmp8_ = gitg_commit_activity_items_for_items (self, _tmp5_, (gint) _tmp5__length1, &_tmp6_, &_tmp7_);
	type = _tmp6_;
	sitems = _tmp8_;
	sitems_length1 = _tmp7_;
	_sitems_size_ = sitems_length1;
	_tmp10_ = sitems;
	_tmp10__length1 = sitems_length1;
	if (_tmp10__length1 != 0) {
		gboolean _tmp11_ = FALSE;
		if (type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNSTAGED) {
			_tmp11_ = TRUE;
		} else {
			_tmp11_ = type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNTRACKED;
		}
		_tmp9_ = _tmp11_;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		GitgStageStatusItem** _tmp12_;
		gint _tmp12__length1;
		_tmp12_ = sitems;
		_tmp12__length1 = sitems_length1;
		gitg_commit_activity_on_unstaged_activated (self, _tmp12_, (gint) _tmp12__length1);
	}
	sitems = (_vala_array_free (sitems, sitems_length1, (GDestroyNotify) g_object_unref), NULL);
	sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
gitg_commit_activity_on_unstage_selected_items (GitgCommitActivity* self)
{
	GitgSidebarItem** sel = NULL;
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	gint _tmp3_ = 0;
	gpointer* _tmp4_;
	gint sel_length1;
	gint _sel_size_;
	GitgCommitSidebarItemType type = 0;
	GitgStageStatusItem** sitems = NULL;
	GitgSidebarItem** _tmp5_;
	gint _tmp5__length1;
	GitgCommitSidebarItemType _tmp6_ = 0;
	gint _tmp7_ = 0;
	GitgStageStatusItem** _tmp8_;
	gint sitems_length1;
	gint _sitems_size_;
	gboolean _tmp9_ = FALSE;
	GitgStageStatusItem** _tmp10_;
	gint _tmp10__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = gitg_sidebar_get_selected_items ((GitgSidebar*) _tmp2_, GITG_TYPE_SIDEBAR_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, &_tmp3_);
	sel = _tmp4_;
	sel_length1 = _tmp3_;
	_sel_size_ = sel_length1;
	_tmp5_ = sel;
	_tmp5__length1 = sel_length1;
	_tmp8_ = gitg_commit_activity_items_for_items (self, _tmp5_, (gint) _tmp5__length1, &_tmp6_, &_tmp7_);
	type = _tmp6_;
	sitems = _tmp8_;
	sitems_length1 = _tmp7_;
	_sitems_size_ = sitems_length1;
	_tmp10_ = sitems;
	_tmp10__length1 = sitems_length1;
	if (_tmp10__length1 != 0) {
		_tmp9_ = type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_STAGED;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		GitgStageStatusItem** _tmp11_;
		gint _tmp11__length1;
		_tmp11_ = sitems;
		_tmp11__length1 = sitems_length1;
		gitg_commit_activity_on_staged_activated (self, _tmp11_, (gint) _tmp11__length1);
	}
	sitems = (_vala_array_free (sitems, sitems_length1, (GDestroyNotify) g_object_unref), NULL);
	sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
}

static Block41Data*
block41_data_ref (Block41Data* _data41_)
{
	g_atomic_int_inc (&_data41_->_ref_count_);
	return _data41_;
}

static void
block41_data_unref (void * _userdata_)
{
	Block41Data* _data41_;
	_data41_ = (Block41Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data41_->_ref_count_)) {
		GitgCommitActivity* self;
		self = _data41_->self;
		_g_object_unref0 (_data41_->model);
		_g_object_unref0 (_data41_->view);
		_g_object_unref0 (self);
		g_slice_free (Block41Data, _data41_);
	}
}

static void
__lambda76_ (GitgCommitActivity* self)
{
	GitgCommitActivityUpdateDiffCallback _tmp0_;
	gpointer _tmp0__target;
	_tmp0_ = self->priv->d_update_diff_callback;
	_tmp0__target = self->priv->d_update_diff_callback_target;
	if (_tmp0_ != NULL) {
		GitgCommitActivityUpdateDiffCallback _tmp1_;
		gpointer _tmp1__target;
		_tmp1_ = self->priv->d_update_diff_callback;
		_tmp1__target = self->priv->d_update_diff_callback_target;
		_tmp1_ (_tmp1__target);
	}
}

static void
___lambda76__gitg_diff_view_options_changed (GitgDiffView* _sender,
                                             gpointer self)
{
	__lambda76_ ((GitgCommitActivity*) self);
}

static void
__lambda77_ (GitgCommitActivity* self)
{
	GitgCommitPaned* _tmp0_;
	GitgDiffView* _tmp1_;
	GitgDiffView* _tmp2_;
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_diff_view (_tmp0_);
	_tmp2_ = _tmp1_;
	gitg_diff_view_set_diff (_tmp2_, NULL);
}

static void
___lambda77__gitg_sidebar_deselected (GitgSidebar* _sender,
                                      gpointer self)
{
	__lambda77_ ((GitgCommitActivity*) self);
}

static void
_gitg_commit_activity_on_stage_selected_items_gitg_commit_sidebar_stage_selection (GitgCommitSidebar* _sender,
                                                                                   gpointer self)
{
	gitg_commit_activity_on_stage_selected_items ((GitgCommitActivity*) self);
}

static void
_gitg_commit_activity_on_unstage_selected_items_gitg_commit_sidebar_unstage_selection (GitgCommitSidebar* _sender,
                                                                                       gpointer self)
{
	gitg_commit_activity_on_unstage_selected_items ((GitgCommitActivity*) self);
}

static void
__lambda78_ (GitgCommitActivity* self)
{
	GitgSidebarItem** sel = NULL;
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	gint _tmp3_ = 0;
	gpointer* _tmp4_;
	gint sel_length1;
	gint _sel_size_;
	GitgCommitSidebarItemType type = 0;
	GitgStageStatusItem** sitems = NULL;
	GitgSidebarItem** _tmp5_;
	gint _tmp5__length1;
	GitgCommitSidebarItemType _tmp6_ = 0;
	gint _tmp7_ = 0;
	GitgStageStatusItem** _tmp8_;
	gint sitems_length1;
	gint _sitems_size_;
	gboolean _tmp9_ = FALSE;
	GitgStageStatusItem** _tmp10_;
	gint _tmp10__length1;
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = gitg_sidebar_get_selected_items ((GitgSidebar*) _tmp2_, GITG_TYPE_SIDEBAR_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, &_tmp3_);
	sel = _tmp4_;
	sel_length1 = _tmp3_;
	_sel_size_ = sel_length1;
	_tmp5_ = sel;
	_tmp5__length1 = sel_length1;
	_tmp8_ = gitg_commit_activity_items_for_items (self, _tmp5_, (gint) _tmp5__length1, &_tmp6_, &_tmp7_);
	type = _tmp6_;
	sitems = _tmp8_;
	sitems_length1 = _tmp7_;
	_sitems_size_ = sitems_length1;
	_tmp10_ = sitems;
	_tmp10__length1 = sitems_length1;
	if (_tmp10__length1 != 0) {
		_tmp9_ = type == GITG_COMMIT_SIDEBAR_ITEM_TYPE_UNSTAGED;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		GitgStageStatusItem** _tmp11_;
		gint _tmp11__length1;
		_tmp11_ = sitems;
		_tmp11__length1 = sitems_length1;
		gitg_commit_activity_on_discard_menu_activated (self, _tmp11_, (gint) _tmp11__length1);
	}
	sitems = (_vala_array_free (sitems, sitems_length1, (GDestroyNotify) g_object_unref), NULL);
	sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
___lambda78__gitg_commit_sidebar_discard_selection (GitgCommitSidebar* _sender,
                                                    gpointer self)
{
	__lambda78_ ((GitgCommitActivity*) self);
}

static void
__lambda79_ (GitgCommitActivity* self)
{
	GitgSidebarItem** sel = NULL;
	GitgCommitPaned* _tmp0_;
	GitgCommitSidebar* _tmp1_;
	GitgCommitSidebar* _tmp2_;
	gint _tmp3_ = 0;
	gpointer* _tmp4_;
	gint sel_length1;
	gint _sel_size_;
	GitgCommitSidebarItemType type = 0;
	GitgStageStatusItem** sitems = NULL;
	GitgCommitSidebarItemType _tmp5_ = 0;
	gint _tmp6_ = 0;
	GitgStageStatusItem** _tmp7_;
	gint sitems_length1;
	gint _sitems_size_;
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_sidebar (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = gitg_sidebar_get_selected_items ((GitgSidebar*) _tmp2_, GITG_TYPE_SIDEBAR_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, &_tmp3_);
	sel = _tmp4_;
	sel_length1 = _tmp3_;
	_sel_size_ = sel_length1;
	_tmp7_ = gitg_commit_activity_items_for_items (self, sel, (gint) sel_length1, &_tmp5_, &_tmp6_);
	type = _tmp5_;
	sitems = _tmp7_;
	sitems_length1 = _tmp6_;
	_sitems_size_ = sitems_length1;
	gitg_commit_activity_do_edit_items (self, sitems, (gint) sitems_length1);
	sitems = (_vala_array_free (sitems, sitems_length1, (GDestroyNotify) g_object_unref), NULL);
	sel = (_vala_array_free (sel, sel_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
___lambda79__gitg_commit_sidebar_edit_selection (GitgCommitSidebar* _sender,
                                                 gpointer self)
{
	__lambda79_ ((GitgCommitActivity*) self);
}

static void
_gitg_commit_activity_sidebar_selection_changed_gitg_commit_sidebar_selected_items_changed (GitgCommitSidebar* _sender,
                                                                                            GitgSidebarItem** items,
                                                                                            gint items_length1,
                                                                                            gpointer self)
{
	gitg_commit_activity_sidebar_selection_changed ((GitgCommitActivity*) self, items, items_length1);
}

static void
__lambda80_ (GitgCommitActivity* self)
{
	gitg_commit_activity_on_commit_clicked (self);
}

static void
___lambda80__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda80_ ((GitgCommitActivity*) self);
}

static void
__lambda81_ (GitgCommitActivity* self)
{
	gitg_commit_activity_on_stage_clicked (self);
}

static void
___lambda81__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda81_ ((GitgCommitActivity*) self);
}

static void
__lambda82_ (GitgCommitActivity* self)
{
	gitg_commit_activity_on_discard_clicked (self);
}

static void
___lambda82__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda82_ ((GitgCommitActivity*) self);
}

static gboolean
___lambda84_ (GitgCommitActivity* self)
{
	gboolean result;
	gitg_commit_activity_reload (self);
	result = FALSE;
	return result;
}

static gboolean
____lambda84__gtk_widget_delete_event (GtkWidget* _sender,
                                       GdkEventAny* event,
                                       gpointer self)
{
	gboolean result;
	result = ___lambda84_ ((GitgCommitActivity*) self);
	return result;
}

static void
__lambda83_ (GitgCommitActivity* self,
             GgitSubmodule* submodule)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (submodule != NULL);
	{
		GgitRepository* _tmp0_ = NULL;
		GgitRepository* _tmp1_;
		GitgExtApplication* app = NULL;
		GitgExtApplication* _tmp2_;
		GitgExtApplication* _tmp3_;
		GitgExtApplication* _tmp4_;
		GitgExtApplication* _tmp5_;
		GitgExtApplication* _tmp6_;
		GitgExtApplication* _tmp7_;
		_tmp1_ = ggit_submodule_open (submodule, &_inner_error0_);
		_tmp0_ = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gitg_ext_application_open_new (_tmp4_, _tmp0_, "commit");
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		app = _tmp6_;
		_tmp7_ = app;
		g_signal_connect_object ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_window_get_type (), GtkWindow), "delete-event", (GCallback) ____lambda84__gtk_widget_delete_event, self, 0);
		_g_object_unref0 (app);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		FILE* _tmp8_;
		GError* _tmp9_;
		const gchar* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = stderr;
		_tmp9_ = e;
		_tmp10_ = _tmp9_->message;
		fprintf (_tmp8_, "Failed to open submodule repository: %s\n", _tmp10_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda83__gitg_commit_submodule_info_request_open_repository (GitgCommitSubmoduleInfo* _sender,
                                                                 GgitSubmodule* submodule,
                                                                 gpointer self)
{
	__lambda83_ ((GitgCommitActivity*) self, submodule);
}

static void
_gitg_commit_activity_do_populate_menu_gitg_sidebar_populate_popup (GitgSidebar* _sender,
                                                                    GtkMenu* menu,
                                                                    gpointer self)
{
	gitg_commit_activity_do_populate_menu ((GitgCommitActivity*) self, menu);
}

static void
__lambda85_ (GitgCommitActivity* self,
             GtkSearchEntry* entry)
{
	g_return_if_fail (entry != NULL);
	gitg_commit_activity_reload (self);
}

static void
___lambda85__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                              gpointer self)
{
	__lambda85_ ((GitgCommitActivity*) self, _sender);
}

static void
__lambda86_ (GitgCommitActivity* self,
             GtkSearchEntry* entry)
{
	GitgCommitPaned* _tmp0_;
	GtkSearchBar* _tmp1_;
	GtkSearchBar* _tmp2_;
	g_return_if_fail (entry != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_commit_paned_get_commit_files_search_bar (_tmp0_);
	_tmp2_ = _tmp1_;
	g_object_set (_tmp2_, "search-mode-enabled", TRUE, NULL);
}

static void
___lambda86__gtk_search_entry_stop_search (GtkSearchEntry* _sender,
                                           gpointer self)
{
	__lambda86_ ((GitgCommitActivity*) self, _sender);
}

static void
__lambda87_ (Block41Data* _data41_,
             GtkTreeModel* model,
             GtkTreePath* path,
             GtkTreeIter* iter)
{
	GitgCommitActivity* self;
	self = _data41_->self;
	g_return_if_fail (model != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (iter != NULL);
	if (self->priv->d_submodule_history_select_first) {
		GtkTreeSelection* _tmp0_;
		self->priv->d_submodule_history_select_first = FALSE;
		_tmp0_ = gtk_tree_view_get_selection ((GtkTreeView*) _data41_->view);
		gtk_tree_selection_select_path (_tmp0_, path);
	}
}

static void
___lambda87__gtk_tree_model_row_inserted (GtkTreeModel* _sender,
                                          GtkTreePath* path,
                                          GtkTreeIter* iter,
                                          gpointer self)
{
	__lambda87_ (self, _sender, path, iter);
}

static void
__lambda88_ (Block41Data* _data41_,
             GtkTreeSelection* selection)
{
	GitgCommitActivity* self;
	GtkTreeModel* m = NULL;
	GtkTreeIter iter = {0};
	GtkTreeModel* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	gboolean _tmp2_;
	GtkTreeModel* _tmp3_;
	self = _data41_->self;
	g_return_if_fail (selection != NULL);
	_tmp2_ = gtk_tree_selection_get_selected (selection, &_tmp0_, &_tmp1_);
	_g_object_unref0 (m);
	_tmp3_ = _g_object_ref0 (_tmp0_);
	m = _tmp3_;
	iter = _tmp1_;
	if (_tmp2_) {
		GtkTreeIter _tmp4_;
		GitgCommit* _tmp5_;
		GitgCommit* _tmp6_;
		_tmp4_ = iter;
		_tmp5_ = gitg_commit_model_commit_from_iter (_data41_->model, &_tmp4_);
		_tmp6_ = _tmp5_;
		gitg_commit_activity_submodule_history_selection_changed (self, _tmp6_);
		_g_object_unref0 (_tmp6_);
	} else {
		gitg_commit_activity_submodule_history_selection_changed (self, NULL);
	}
	_g_object_unref0 (m);
}

static void
___lambda88__gtk_tree_selection_changed (GtkTreeSelection* _sender,
                                         gpointer self)
{
	__lambda88_ (self, _sender);
}

static void
__lambda89_ (Block41Data* _data41_,
             GtkTreeView* view,
             GtkTreePath* path,
             GtkTreeViewColumn* column)
{
	GitgCommitActivity* self;
	GitgCommitActivityStageUnstageSubmoduleCommitCallback _tmp0_;
	gpointer _tmp0__target;
	GitgCommit* _tmp1_;
	GitgCommit* _tmp2_;
	self = _data41_->self;
	g_return_if_fail (view != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (column != NULL);
	_tmp0_ = self->priv->d_stage_unstage_submodule_commit_callback;
	_tmp0__target = self->priv->d_stage_unstage_submodule_commit_callback_target;
	_tmp1_ = gitg_commit_model_commit_from_path (_data41_->model, path);
	_tmp2_ = _tmp1_;
	_tmp0_ (_tmp2_, _tmp0__target);
	_g_object_unref0 (_tmp2_);
}

static void
___lambda89__gtk_tree_view_row_activated (GtkTreeView* _sender,
                                          GtkTreePath* path,
                                          GtkTreeViewColumn* column,
                                          gpointer self)
{
	__lambda89_ (self, _sender, path, column);
}

static void
gitg_commit_activity_build_ui (GitgCommitActivity* self)
{
	Block41Data* _data41_;
	GitgCommitPaned* _tmp0_;
	GitgCommitPaned* _tmp1_;
	GitgDiffView* _tmp2_;
	GitgDiffView* _tmp3_;
	GitgCommitPaned* _tmp4_;
	GitgDiffView* _tmp5_;
	GitgDiffView* _tmp6_;
	GitgExtApplication* _tmp7_;
	GitgExtApplication* _tmp8_;
	GitgExtApplication* _tmp9_;
	GitgRepository* _tmp10_;
	GitgRepository* _tmp11_;
	GitgRepository* _tmp12_;
	GitgCommitPaned* _tmp13_;
	GitgDiffView* _tmp14_;
	GitgDiffView* _tmp15_;
	GitgCommitPaned* _tmp16_;
	GitgCommitSidebar* _tmp17_;
	GitgCommitSidebar* _tmp18_;
	GitgCommitPaned* _tmp19_;
	GitgCommitSidebar* _tmp20_;
	GitgCommitSidebar* _tmp21_;
	GitgCommitPaned* _tmp22_;
	GitgCommitSidebar* _tmp23_;
	GitgCommitSidebar* _tmp24_;
	GitgCommitPaned* _tmp25_;
	GitgCommitSidebar* _tmp26_;
	GitgCommitSidebar* _tmp27_;
	GitgCommitPaned* _tmp28_;
	GitgCommitSidebar* _tmp29_;
	GitgCommitSidebar* _tmp30_;
	GitgCommitPaned* _tmp31_;
	GitgCommitSidebar* _tmp32_;
	GitgCommitSidebar* _tmp33_;
	GitgCommitPaned* _tmp34_;
	GtkButton* _tmp35_;
	GtkButton* _tmp36_;
	GitgCommitPaned* _tmp37_;
	GtkButton* _tmp38_;
	GtkButton* _tmp39_;
	GitgCommitPaned* _tmp40_;
	GtkButton* _tmp41_;
	GtkButton* _tmp42_;
	GitgCommitPaned* _tmp43_;
	GitgCommitSubmoduleDiffView* _tmp44_;
	GitgCommitSubmoduleDiffView* _tmp45_;
	GitgCommitSubmoduleInfo* _tmp46_;
	GitgCommitSubmoduleInfo* _tmp47_;
	GitgCommitPaned* _tmp48_;
	GitgCommitSidebar* _tmp49_;
	GitgCommitSidebar* _tmp50_;
	GitgCommitPaned* _tmp51_;
	GtkSearchBar* _tmp52_;
	GtkSearchBar* _tmp53_;
	GitgCommitPaned* _tmp54_;
	GtkSearchEntry* _tmp55_;
	GtkSearchEntry* _tmp56_;
	GitgCommitPaned* _tmp57_;
	GtkSearchEntry* _tmp58_;
	GtkSearchEntry* _tmp59_;
	GitgCommitPaned* _tmp60_;
	GtkSearchEntry* _tmp61_;
	GtkSearchEntry* _tmp62_;
	GitgCommitPaned* _tmp63_;
	GitgCommitSubmoduleHistoryView* _tmp64_;
	GitgCommitSubmoduleHistoryView* _tmp65_;
	GitgCommitListView* _tmp66_;
	GitgCommitListView* _tmp67_;
	GitgCommitListView* _tmp68_;
	GitgCommitModel* _tmp69_;
	GtkTreeSelection* _tmp70_;
	GSettings* settings = NULL;
	GSettings* _tmp71_;
	GSettings* _tmp72_;
	GitgCommitPaned* _tmp73_;
	GitgDiffView* _tmp74_;
	GitgDiffView* _tmp75_;
	GSettings* _tmp76_;
	GitgCommitPaned* _tmp77_;
	GitgDiffView* _tmp78_;
	GitgDiffView* _tmp79_;
	GSettings* _tmp80_;
	GSettings* _tmp81_;
	GitgCommitPaned* _tmp82_;
	GitgDiffView* _tmp83_;
	GitgDiffView* _tmp84_;
	GSettings* _tmp85_;
	GitgCommitPaned* _tmp86_;
	GitgDiffView* _tmp87_;
	GitgDiffView* _tmp88_;
	GitgCommitPaned* _tmp89_;
	GitgDiffView* _tmp90_;
	GitgDiffView* _tmp91_;
	GitgCommitPaned* _tmp92_;
	GtkButton* _tmp93_;
	GtkButton* _tmp94_;
	GitgCommitPaned* _tmp95_;
	GitgDiffView* _tmp96_;
	GitgDiffView* _tmp97_;
	GitgCommitPaned* _tmp98_;
	GtkButton* _tmp99_;
	GtkButton* _tmp100_;
	GitgExtApplication* _tmp101_;
	GitgExtApplication* _tmp102_;
	GitgExtApplication* _tmp103_;
	GitgCommitPaned* _tmp104_;
	GitgDiffView* _tmp105_;
	GitgDiffView* _tmp106_;
	g_return_if_fail (self != NULL);
	_data41_ = g_slice_new0 (Block41Data);
	_data41_->_ref_count_ = 1;
	_data41_->self = g_object_ref (self);
	_tmp0_ = gitg_commit_paned_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->d_main);
	self->priv->d_main = _tmp0_;
	_tmp1_ = self->priv->d_main;
	_tmp2_ = gitg_commit_paned_get_diff_view (_tmp1_);
	_tmp3_ = _tmp2_;
	g_signal_connect_object (_tmp3_, "options-changed", (GCallback) ___lambda76__gitg_diff_view_options_changed, self, 0);
	_tmp4_ = self->priv->d_main;
	_tmp5_ = gitg_commit_paned_get_diff_view (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp10_ = gitg_ext_application_get_repository (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = _tmp11_;
	gitg_diff_view_set_repository (_tmp6_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	_g_object_unref0 (_tmp9_);
	_tmp13_ = self->priv->d_main;
	_tmp14_ = gitg_commit_paned_get_diff_view (_tmp13_);
	_tmp15_ = _tmp14_;
	gitg_diff_view_set_default_collapse_all (_tmp15_, FALSE);
	_tmp16_ = self->priv->d_main;
	_tmp17_ = gitg_commit_paned_get_sidebar (_tmp16_);
	_tmp18_ = _tmp17_;
	g_signal_connect_object ((GitgSidebar*) _tmp18_, "deselected", (GCallback) ___lambda77__gitg_sidebar_deselected, self, 0);
	_tmp19_ = self->priv->d_main;
	_tmp20_ = gitg_commit_paned_get_sidebar (_tmp19_);
	_tmp21_ = _tmp20_;
	g_signal_connect_object (_tmp21_, "stage-selection", (GCallback) _gitg_commit_activity_on_stage_selected_items_gitg_commit_sidebar_stage_selection, self, 0);
	_tmp22_ = self->priv->d_main;
	_tmp23_ = gitg_commit_paned_get_sidebar (_tmp22_);
	_tmp24_ = _tmp23_;
	g_signal_connect_object (_tmp24_, "unstage-selection", (GCallback) _gitg_commit_activity_on_unstage_selected_items_gitg_commit_sidebar_unstage_selection, self, 0);
	_tmp25_ = self->priv->d_main;
	_tmp26_ = gitg_commit_paned_get_sidebar (_tmp25_);
	_tmp27_ = _tmp26_;
	g_signal_connect_object (_tmp27_, "discard-selection", (GCallback) ___lambda78__gitg_commit_sidebar_discard_selection, self, 0);
	_tmp28_ = self->priv->d_main;
	_tmp29_ = gitg_commit_paned_get_sidebar (_tmp28_);
	_tmp30_ = _tmp29_;
	g_signal_connect_object (_tmp30_, "edit-selection", (GCallback) ___lambda79__gitg_commit_sidebar_edit_selection, self, 0);
	_tmp31_ = self->priv->d_main;
	_tmp32_ = gitg_commit_paned_get_sidebar (_tmp31_);
	_tmp33_ = _tmp32_;
	g_signal_connect_object (_tmp33_, "selected-items-changed", (GCallback) _gitg_commit_activity_sidebar_selection_changed_gitg_commit_sidebar_selected_items_changed, self, 0);
	_tmp34_ = self->priv->d_main;
	_tmp35_ = gitg_commit_paned_get_button_commit (_tmp34_);
	_tmp36_ = _tmp35_;
	g_signal_connect_object (_tmp36_, "clicked", (GCallback) ___lambda80__gtk_button_clicked, self, 0);
	_tmp37_ = self->priv->d_main;
	_tmp38_ = gitg_commit_paned_get_button_stage (_tmp37_);
	_tmp39_ = _tmp38_;
	g_signal_connect_object (_tmp39_, "clicked", (GCallback) ___lambda81__gtk_button_clicked, self, 0);
	_tmp40_ = self->priv->d_main;
	_tmp41_ = gitg_commit_paned_get_button_discard (_tmp40_);
	_tmp42_ = _tmp41_;
	g_signal_connect_object (_tmp42_, "clicked", (GCallback) ___lambda82__gtk_button_clicked, self, 0);
	_tmp43_ = self->priv->d_main;
	_tmp44_ = gitg_commit_paned_get_submodule_diff_view (_tmp43_);
	_tmp45_ = _tmp44_;
	_tmp46_ = gitg_commit_submodule_diff_view_get_info (_tmp45_);
	_tmp47_ = _tmp46_;
	g_signal_connect_object (_tmp47_, "request-open-repository", (GCallback) ___lambda83__gitg_commit_submodule_info_request_open_repository, self, 0);
	_tmp48_ = self->priv->d_main;
	_tmp49_ = gitg_commit_paned_get_sidebar (_tmp48_);
	_tmp50_ = _tmp49_;
	g_signal_connect_object ((GitgSidebar*) _tmp50_, "populate-popup", (GCallback) _gitg_commit_activity_do_populate_menu_gitg_sidebar_populate_popup, self, 0);
	_tmp51_ = self->priv->d_main;
	_tmp52_ = gitg_commit_paned_get_commit_files_search_bar (_tmp51_);
	_tmp53_ = _tmp52_;
	_tmp54_ = self->priv->d_main;
	_tmp55_ = gitg_commit_paned_get_commit_files_search_entry (_tmp54_);
	_tmp56_ = _tmp55_;
	gtk_search_bar_connect_entry (_tmp53_, (GtkEntry*) _tmp56_);
	_tmp57_ = self->priv->d_main;
	_tmp58_ = gitg_commit_paned_get_commit_files_search_entry (_tmp57_);
	_tmp59_ = _tmp58_;
	g_signal_connect_object (_tmp59_, "search-changed", (GCallback) ___lambda85__gtk_search_entry_search_changed, self, 0);
	_tmp60_ = self->priv->d_main;
	_tmp61_ = gitg_commit_paned_get_commit_files_search_entry (_tmp60_);
	_tmp62_ = _tmp61_;
	g_signal_connect_object (_tmp62_, "stop-search", (GCallback) ___lambda86__gtk_search_entry_stop_search, self, 0);
	_tmp63_ = self->priv->d_main;
	_tmp64_ = gitg_commit_paned_get_submodule_history_view (_tmp63_);
	_tmp65_ = _tmp64_;
	_tmp66_ = gitg_commit_submodule_history_view_get_commit_list_view (_tmp65_);
	_tmp67_ = _tmp66_;
	_tmp68_ = _g_object_ref0 (_tmp67_);
	_data41_->view = _tmp68_;
	_tmp69_ = gitg_commit_model_new (NULL);
	_data41_->model = _tmp69_;
	gtk_tree_view_set_model ((GtkTreeView*) _data41_->view, (GtkTreeModel*) _data41_->model);
	g_signal_connect_data ((GtkTreeModel*) _data41_->model, "row-inserted", (GCallback) ___lambda87__gtk_tree_model_row_inserted, block41_data_ref (_data41_), (GClosureNotify) block41_data_unref, G_CONNECT_AFTER);
	_tmp70_ = gtk_tree_view_get_selection ((GtkTreeView*) _data41_->view);
	g_signal_connect_data (_tmp70_, "changed", (GCallback) ___lambda88__gtk_tree_selection_changed, block41_data_ref (_data41_), (GClosureNotify) block41_data_unref, 0);
	g_signal_connect_data ((GtkTreeView*) _data41_->view, "row-activated", (GCallback) ___lambda89__gtk_tree_view_row_activated, block41_data_ref (_data41_), (GClosureNotify) block41_data_unref, 0);
	_tmp71_ = g_settings_new (APPLICATION_ID ".preferences.commit.diff");
	settings = _tmp71_;
	_tmp72_ = settings;
	_tmp73_ = self->priv->d_main;
	_tmp74_ = gitg_commit_paned_get_diff_view (_tmp73_);
	_tmp75_ = _tmp74_;
	g_settings_bind (_tmp72_, "context-lines", (GObject*) _tmp75_, "context-lines", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp76_ = settings;
	_tmp77_ = self->priv->d_main;
	_tmp78_ = gitg_commit_paned_get_diff_view (_tmp77_);
	_tmp79_ = _tmp78_;
	g_settings_bind (_tmp76_, "tab-width", (GObject*) _tmp79_, "tab-width", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp80_ = g_settings_new (APPLICATION_ID ".preferences.interface");
	_g_object_unref0 (settings);
	settings = _tmp80_;
	_tmp81_ = settings;
	_tmp82_ = self->priv->d_main;
	_tmp83_ = gitg_commit_paned_get_diff_view (_tmp82_);
	_tmp84_ = _tmp83_;
	g_settings_bind (_tmp81_, "use-gravatar", (GObject*) _tmp84_, "use-gravatar", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp85_ = settings;
	_tmp86_ = self->priv->d_main;
	_tmp87_ = gitg_commit_paned_get_diff_view (_tmp86_);
	_tmp88_ = _tmp87_;
	g_settings_bind (_tmp85_, "enable-diff-highlighting", (GObject*) _tmp88_, "highlight", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp89_ = self->priv->d_main;
	_tmp90_ = gitg_commit_paned_get_diff_view (_tmp89_);
	_tmp91_ = _tmp90_;
	_tmp92_ = self->priv->d_main;
	_tmp93_ = gitg_commit_paned_get_button_stage (_tmp92_);
	_tmp94_ = _tmp93_;
	g_object_bind_property_with_closures ((GObject*) _tmp91_, "has-selection", (GObject*) _tmp94_, "sensitive", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp95_ = self->priv->d_main;
	_tmp96_ = gitg_commit_paned_get_diff_view (_tmp95_);
	_tmp97_ = _tmp96_;
	_tmp98_ = self->priv->d_main;
	_tmp99_ = gitg_commit_paned_get_button_discard (_tmp98_);
	_tmp100_ = _tmp99_;
	g_object_bind_property_with_closures ((GObject*) _tmp97_, "has-selection", (GObject*) _tmp100_, "sensitive", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp101_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp102_ = _tmp101_;
	_tmp103_ = _tmp102_;
	_tmp104_ = self->priv->d_main;
	_tmp105_ = gitg_commit_paned_get_diff_view (_tmp104_);
	_tmp106_ = _tmp105_;
	g_object_bind_property_with_closures ((GObject*) _tmp103_, "repository", (GObject*) _tmp106_, "repository", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_g_object_unref0 (_tmp103_);
	_g_object_unref0 (settings);
	block41_data_unref (_data41_);
	_data41_ = NULL;
}

static GitgExtApplication*
gitg_commit_activity_real_get_application (GitgExtUIElement* base)
{
	GitgExtApplication* result;
	GitgCommitActivity* self;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	self = (GitgCommitActivity*) base;
	_tmp0_ = self->priv->_application;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
gitg_commit_activity_real_set_application (GitgExtUIElement* base,
                                           GitgExtApplication* value)
{
	GitgCommitActivity* self;
	GitgExtApplication* old_value;
	self = (GitgCommitActivity*) base;
	old_value = gitg_commit_activity_real_get_application (base);
	if (old_value != value) {
		GitgExtApplication* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_application);
		self->priv->_application = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_APPLICATION_PROPERTY]);
	}
	_g_object_unref0 (old_value);
}

static gchar*
gitg_commit_activity_real_get_id (GitgExtUIElement* base)
{
	gchar* result;
	GitgCommitActivity* self;
	gchar* _tmp0_;
	self = (GitgCommitActivity*) base;
	_tmp0_ = g_strdup ("/org/gnome/gitg/Activities/Commit");
	result = _tmp0_;
	return result;
}

void
gitg_commit_activity_set_repository (GitgCommitActivity* self,
                                     GitgRepository* value)
{
	g_return_if_fail (self != NULL);
	gitg_commit_activity_reload (self);
	g_object_notify ((GObject*) self, "enabled");
	g_object_notify_by_pspec ((GObject *) self, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_REPOSITORY_PROPERTY]);
}

static gboolean
gitg_commit_activity_real_get_enabled (GitgExtUIElement* base)
{
	gboolean result;
	GitgCommitActivity* self;
	gboolean _tmp0_ = FALSE;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgRepository* _tmp6_;
	gboolean _tmp7_;
	self = (GitgCommitActivity*) base;
	_tmp1_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = gitg_ext_application_get_repository (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_ != NULL;
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (_tmp3_);
	if (_tmp7_) {
		GitgExtApplication* _tmp8_;
		GitgExtApplication* _tmp9_;
		GitgExtApplication* _tmp10_;
		GitgRepository* _tmp11_;
		GitgRepository* _tmp12_;
		GitgRepository* _tmp13_;
		gboolean _tmp14_;
		gboolean _tmp15_;
		_tmp8_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		_tmp11_ = gitg_ext_application_get_repository (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		g_object_get ((GgitRepository*) _tmp13_, "is-bare", &_tmp14_, NULL);
		_tmp15_ = _tmp14_;
		_tmp0_ = !_tmp15_;
		_g_object_unref0 (_tmp13_);
		_g_object_unref0 (_tmp10_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gchar*
gitg_commit_activity_real_get_display_name (GitgExtUIElement* base)
{
	gchar* result;
	GitgCommitActivity* self;
	gchar* _tmp0_;
	self = (GitgCommitActivity*) base;
	_tmp0_ = g_strdup (C_ ("Activity", "Commit"));
	result = _tmp0_;
	return result;
}

static gchar*
gitg_commit_activity_real_get_description (GitgExtUIElement* base)
{
	gchar* result;
	GitgCommitActivity* self;
	gchar* _tmp0_;
	self = (GitgCommitActivity*) base;
	_tmp0_ = g_strdup (_ ("Create new commits and manage the staging area"));
	result = _tmp0_;
	return result;
}

static gchar*
gitg_commit_activity_real_get_icon (GitgExtUIElement* base)
{
	gchar* result;
	GitgCommitActivity* self;
	gchar* _tmp0_;
	self = (GitgCommitActivity*) base;
	_tmp0_ = g_strdup ("document-save-symbolic");
	result = _tmp0_;
	return result;
}

static GtkWidget*
gitg_commit_activity_real_get_widget (GitgExtUIElement* base)
{
	GtkWidget* result;
	GitgCommitActivity* self;
	GitgCommitPaned* _tmp0_;
	GitgCommitPaned* _tmp1_;
	GtkWidget* _tmp2_;
	self = (GitgCommitActivity*) base;
	_tmp0_ = self->priv->d_main;
	if (_tmp0_ == NULL) {
		gitg_commit_activity_build_ui (self);
	}
	_tmp1_ = self->priv->d_main;
	_tmp2_ = _g_object_ref0 ((GtkWidget*) _tmp1_);
	result = _tmp2_;
	return result;
}

static void
_gitg_commit_activity_repository_changed_externally_gitg_ext_application_repository_changed_externally (GitgExtApplication* _sender,
                                                                                                        GitgExtExternalChangeHint hint,
                                                                                                        gpointer self)
{
	gitg_commit_activity_repository_changed_externally ((GitgCommitActivity*) self, hint);
}

static GObject *
gitg_commit_activity_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GitgCommitActivity * self;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	GitgExtApplication* _tmp4_;
	GitgExtApplication* _tmp5_;
	gulong _tmp6_;
	parent_class = G_OBJECT_CLASS (gitg_commit_activity_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivity);
	_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	g_object_bind_property_with_closures ((GObject*) _tmp2_, "repository", (GObject*) self, "repository", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_g_object_unref0 (_tmp2_);
	_tmp3_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = g_signal_connect_object (_tmp5_, "repository-changed-externally", (GCallback) _gitg_commit_activity_repository_changed_externally_gitg_ext_application_repository_changed_externally, self, 0);
	self->priv->d_externally_changed_id = _tmp6_;
	_g_object_unref0 (_tmp5_);
	return obj;
}

static void
gitg_commit_activity_class_init (GitgCommitActivityClass * klass,
                                 gpointer klass_data)
{
	gitg_commit_activity_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgCommitActivity_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) gitg_commit_activity_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_commit_activity_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_commit_activity_set_property;
	G_OBJECT_CLASS (klass)->constructor = gitg_commit_activity_constructor;
	G_OBJECT_CLASS (klass)->finalize = gitg_commit_activity_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTIVITY_APPLICATION_PROPERTY, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_APPLICATION_PROPERTY] = g_param_spec_object ("application", "application", "application", GITG_EXT_TYPE_APPLICATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTIVITY_ID_PROPERTY, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTIVITY_REPOSITORY_PROPERTY, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_REPOSITORY_PROPERTY] = g_param_spec_object ("repository", "repository", "repository", GITG_TYPE_REPOSITORY, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTIVITY_ENABLED_PROPERTY, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_ENABLED_PROPERTY] = g_param_spec_boolean ("enabled", "enabled", "enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTIVITY_DISPLAY_NAME_PROPERTY, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTIVITY_DESCRIPTION_PROPERTY, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTIVITY_ICON_PROPERTY, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_ICON_PROPERTY] = g_param_spec_string ("icon", "icon", "icon", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTIVITY_WIDGET_PROPERTY, gitg_commit_activity_properties[GITG_COMMIT_ACTIVITY_WIDGET_PROPERTY] = g_param_spec_object ("widget", "widget", "widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gitg_commit_activity_gitg_ext_ui_element_interface_init (GitgExtUIElementIface * iface,
                                                         gpointer iface_data)
{
	gitg_commit_activity_gitg_ext_ui_element_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate = (void (*) (GitgExtUIElement*)) gitg_commit_activity_real_activate;
	iface->get_application = gitg_commit_activity_real_get_application;
	iface->set_application = gitg_commit_activity_real_set_application;
	iface->get_id = gitg_commit_activity_real_get_id;
	iface->get_enabled = gitg_commit_activity_real_get_enabled;
	iface->get_display_name = gitg_commit_activity_real_get_display_name;
	iface->get_description = gitg_commit_activity_real_get_description;
	iface->get_icon = gitg_commit_activity_real_get_icon;
	iface->get_widget = gitg_commit_activity_real_get_widget;
}

static void
gitg_commit_activity_gitg_ext_activity_interface_init (GitgExtActivityIface * iface,
                                                       gpointer iface_data)
{
	gitg_commit_activity_gitg_ext_activity_parent_iface = g_type_interface_peek_parent (iface);
	iface->is_default_for = (gboolean (*) (GitgExtActivity*, const gchar*)) gitg_commit_activity_real_is_default_for;
	iface->on_key_pressed = (gboolean (*) (GitgExtActivity*, GdkEventKey*)) gitg_commit_activity_real_on_key_pressed;
}

static void
gitg_commit_activity_instance_init (GitgCommitActivity * self,
                                    gpointer klass)
{
	self->priv = gitg_commit_activity_get_instance_private (self);
}

static void
gitg_commit_activity_finalize (GObject * obj)
{
	GitgCommitActivity * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivity);
	_g_object_unref0 (self->priv->d_main);
	_gitg_when_mapped_unref0 (self->priv->d_reload_when_mapped);
	_g_object_unref0 (self->priv->_application);
	(self->priv->d_update_diff_callback_target_destroy_notify == NULL) ? NULL : (self->priv->d_update_diff_callback_target_destroy_notify (self->priv->d_update_diff_callback_target), NULL);
	self->priv->d_update_diff_callback = NULL;
	self->priv->d_update_diff_callback_target = NULL;
	self->priv->d_update_diff_callback_target_destroy_notify = NULL;
	_g_object_unref0 (self->priv->d_current_submodule);
	_g_object_unref0 (self->priv->d_current_submodule_repository);
	(self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify == NULL) ? NULL : (self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify (self->priv->d_stage_unstage_submodule_commit_callback_target), NULL);
	self->priv->d_stage_unstage_submodule_commit_callback = NULL;
	self->priv->d_stage_unstage_submodule_commit_callback_target = NULL;
	self->priv->d_stage_unstage_submodule_commit_callback_target_destroy_notify = NULL;
	G_OBJECT_CLASS (gitg_commit_activity_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_commit_activity_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgCommitActivityClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_commit_activity_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgCommitActivity), 0, (GInstanceInitFunc) gitg_commit_activity_instance_init, NULL };
	static const GInterfaceInfo gitg_ext_ui_element_info = { (GInterfaceInitFunc) gitg_commit_activity_gitg_ext_ui_element_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gitg_ext_activity_info = { (GInterfaceInitFunc) gitg_commit_activity_gitg_ext_activity_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gitg_commit_activity_type_id;
	gitg_commit_activity_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgCommitActivity", &g_define_type_info, 0);
	g_type_add_interface_static (gitg_commit_activity_type_id, GITG_EXT_TYPE_UI_ELEMENT, &gitg_ext_ui_element_info);
	g_type_add_interface_static (gitg_commit_activity_type_id, GITG_EXT_TYPE_ACTIVITY, &gitg_ext_activity_info);
	GitgCommitActivity_private_offset = g_type_add_instance_private (gitg_commit_activity_type_id, sizeof (GitgCommitActivityPrivate));
	return gitg_commit_activity_type_id;
}

GType
gitg_commit_activity_get_type (void)
{
	static gsize gitg_commit_activity_type_id__once = 0;
	if (g_once_init_enter (&gitg_commit_activity_type_id__once)) {
		GType gitg_commit_activity_type_id;
		gitg_commit_activity_type_id = gitg_commit_activity_get_type_once ();
		g_once_init_leave (&gitg_commit_activity_type_id__once, gitg_commit_activity_type_id);
	}
	return gitg_commit_activity_type_id__once;
}

static void
_vala_gitg_commit_activity_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	GitgCommitActivity * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivity);
	switch (property_id) {
		case GITG_COMMIT_ACTIVITY_APPLICATION_PROPERTY:
		g_value_take_object (value, gitg_ext_ui_element_get_application ((GitgExtUIElement*) self));
		break;
		case GITG_COMMIT_ACTIVITY_ID_PROPERTY:
		g_value_take_string (value, gitg_ext_ui_element_get_id ((GitgExtUIElement*) self));
		break;
		case GITG_COMMIT_ACTIVITY_ENABLED_PROPERTY:
		g_value_set_boolean (value, gitg_ext_ui_element_get_enabled ((GitgExtUIElement*) self));
		break;
		case GITG_COMMIT_ACTIVITY_DISPLAY_NAME_PROPERTY:
		g_value_take_string (value, gitg_ext_ui_element_get_display_name ((GitgExtUIElement*) self));
		break;
		case GITG_COMMIT_ACTIVITY_DESCRIPTION_PROPERTY:
		g_value_take_string (value, gitg_ext_ui_element_get_description ((GitgExtUIElement*) self));
		break;
		case GITG_COMMIT_ACTIVITY_ICON_PROPERTY:
		g_value_take_string (value, gitg_ext_ui_element_get_icon ((GitgExtUIElement*) self));
		break;
		case GITG_COMMIT_ACTIVITY_WIDGET_PROPERTY:
		g_value_take_object (value, gitg_ext_ui_element_get_widget ((GitgExtUIElement*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_commit_activity_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	GitgCommitActivity * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivity);
	switch (property_id) {
		case GITG_COMMIT_ACTIVITY_APPLICATION_PROPERTY:
		gitg_ext_ui_element_set_application ((GitgExtUIElement*) self, g_value_get_object (value));
		break;
		case GITG_COMMIT_ACTIVITY_REPOSITORY_PROPERTY:
		gitg_commit_activity_set_repository (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

