/* gitg-remote-manager.c generated by valac 0.34.7, the Vala compiler
 * generated from gitg-remote-manager.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.h>
#include <glib-object.h>
#include "libgitg-ext/libgitg-ext.h"
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include "libgitg/libgitg.h"
#include <gtk/gtk.h>
#include <libgit2-glib/ggit.h>
#include <stdio.h>


#define GITG_TYPE_REMOTE_MANAGER (gitg_remote_manager_get_type ())
#define GITG_REMOTE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REMOTE_MANAGER, GitgRemoteManager))
#define GITG_REMOTE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REMOTE_MANAGER, GitgRemoteManagerClass))
#define GITG_IS_REMOTE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REMOTE_MANAGER))
#define GITG_IS_REMOTE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REMOTE_MANAGER))
#define GITG_REMOTE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REMOTE_MANAGER, GitgRemoteManagerClass))

typedef struct _GitgRemoteManager GitgRemoteManager;
typedef struct _GitgRemoteManagerClass GitgRemoteManagerClass;
typedef struct _GitgRemoteManagerPrivate GitgRemoteManagerPrivate;

#define GITG_REMOTE_MANAGER_TYPE_INSTEAD_OF (gitg_remote_manager_instead_of_get_type ())
typedef struct _GitgRemoteManagerInsteadOf GitgRemoteManagerInsteadOf;

#define GITG_TYPE_WINDOW (gitg_window_get_type ())
#define GITG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_WINDOW, GitgWindow))
#define GITG_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_WINDOW, GitgWindowClass))
#define GITG_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_WINDOW))
#define GITG_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_WINDOW))
#define GITG_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_WINDOW, GitgWindowClass))

typedef struct _GitgWindow GitgWindow;
typedef struct _GitgWindowClass GitgWindowClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define GITG_REMOTE_MANAGER_TYPE_UI_CREDENTIALS_PROVIDER (gitg_remote_manager_ui_credentials_provider_get_type ())
#define GITG_REMOTE_MANAGER_UI_CREDENTIALS_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_REMOTE_MANAGER_TYPE_UI_CREDENTIALS_PROVIDER, GitgRemoteManagerUICredentialsProvider))
#define GITG_REMOTE_MANAGER_UI_CREDENTIALS_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_REMOTE_MANAGER_TYPE_UI_CREDENTIALS_PROVIDER, GitgRemoteManagerUICredentialsProviderClass))
#define GITG_REMOTE_MANAGER_IS_UI_CREDENTIALS_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_REMOTE_MANAGER_TYPE_UI_CREDENTIALS_PROVIDER))
#define GITG_REMOTE_MANAGER_IS_UI_CREDENTIALS_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_REMOTE_MANAGER_TYPE_UI_CREDENTIALS_PROVIDER))
#define GITG_REMOTE_MANAGER_UI_CREDENTIALS_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_REMOTE_MANAGER_TYPE_UI_CREDENTIALS_PROVIDER, GitgRemoteManagerUICredentialsProviderClass))

typedef struct _GitgRemoteManagerUICredentialsProvider GitgRemoteManagerUICredentialsProvider;
typedef struct _GitgRemoteManagerUICredentialsProviderClass GitgRemoteManagerUICredentialsProviderClass;
typedef struct _GitgRemoteManagerUICredentialsProviderPrivate GitgRemoteManagerUICredentialsProviderPrivate;
#define _gitg_credentials_manager_unref0(var) ((var == NULL) ? NULL : (var = (gitg_credentials_manager_unref (var), NULL)))

struct _GitgRemoteManager {
	GObject parent_instance;
	GitgRemoteManagerPrivate * priv;
};

struct _GitgRemoteManagerClass {
	GObjectClass parent_class;
};

struct _GitgRemoteManagerInsteadOf {
	gchar* prefix;
	gchar* replacement;
};

struct _GitgRemoteManagerPrivate {
	GeeHashMap* d_remotes;
	GitgRemoteManagerInsteadOf* d_insteadof;
	gint d_insteadof_length1;
	gint _d_insteadof_size_;
	GitgWindow* d_window;
};

struct _GitgRemoteManagerUICredentialsProvider {
	GObject parent_instance;
	GitgRemoteManagerUICredentialsProviderPrivate * priv;
};

struct _GitgRemoteManagerUICredentialsProviderClass {
	GObjectClass parent_class;
};

struct _GitgRemoteManagerUICredentialsProviderPrivate {
	GitgCredentialsManager* d_credentials;
};


static gpointer gitg_remote_manager_parent_class = NULL;
static gpointer gitg_remote_manager_ui_credentials_provider_parent_class = NULL;
static GitgCredentialsProviderIface* gitg_remote_manager_ui_credentials_provider_gitg_credentials_provider_parent_iface = NULL;
static GitgExtRemoteLookupIface* gitg_remote_manager_gitg_ext_remote_lookup_parent_iface = NULL;

GType gitg_remote_manager_get_type (void) G_GNUC_CONST;
static GType gitg_remote_manager_instead_of_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GitgRemoteManagerInsteadOf* gitg_remote_manager_instead_of_dup (const GitgRemoteManagerInsteadOf* self);
static void gitg_remote_manager_instead_of_free (GitgRemoteManagerInsteadOf* self);
static void gitg_remote_manager_instead_of_copy (const GitgRemoteManagerInsteadOf* self, GitgRemoteManagerInsteadOf* dest);
static void gitg_remote_manager_instead_of_destroy (GitgRemoteManagerInsteadOf* self);
GType gitg_window_get_type (void) G_GNUC_CONST;
#define GITG_REMOTE_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GITG_TYPE_REMOTE_MANAGER, GitgRemoteManagerPrivate))
enum  {
	GITG_REMOTE_MANAGER_DUMMY_PROPERTY
};
static void _vala_GitgRemoteManagerInsteadOf_array_free (GitgRemoteManagerInsteadOf* array, gint array_length);
GitgRemoteManager* gitg_remote_manager_new (GitgWindow* window);
GitgRemoteManager* gitg_remote_manager_construct (GType object_type, GitgWindow* window);
static void gitg_remote_manager_extract_insteadof (GitgRemoteManager* self);
static gint ___lambda110_ (GitgRemoteManager* self, GMatchInfo* info, const gchar* value);
static void _vala_array_add19 (GitgRemoteManagerInsteadOf** array, int* length, int* size, const GitgRemoteManagerInsteadOf* value);
static gint ____lambda110__ggit_config_match_callback (GMatchInfo* match_info, const gchar* value, gpointer self);
static GitgRemote* gitg_remote_manager_real_lookup (GitgExtRemoteLookup* base, const gchar* name);
static GitgRemoteManagerUICredentialsProvider* gitg_remote_manager_ui_credentials_provider_new (GitgRemote* remote, GtkWindow* window);
static GitgRemoteManagerUICredentialsProvider* gitg_remote_manager_ui_credentials_provider_construct (GType object_type, GitgRemote* remote, GtkWindow* window);
static GType gitg_remote_manager_ui_credentials_provider_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define GITG_REMOTE_MANAGER_UI_CREDENTIALS_PROVIDER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GITG_REMOTE_MANAGER_TYPE_UI_CREDENTIALS_PROVIDER, GitgRemoteManagerUICredentialsProviderPrivate))
enum  {
	GITG_REMOTE_MANAGER_UI_CREDENTIALS_PROVIDER_DUMMY_PROPERTY
};
static GgitCred* gitg_remote_manager_ui_credentials_provider_real_credentials (GitgCredentialsProvider* base, const gchar* url, const gchar* username_from_url, GgitCredtype allowed_types, GError** error);
static void gitg_remote_manager_ui_credentials_provider_finalize (GObject* obj);
static void gitg_remote_manager_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static void _vala_GitgRemoteManagerInsteadOf_array_free (GitgRemoteManagerInsteadOf* array, gint array_length) {
#line 56 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (array != NULL) {
#line 153 "gitg-remote-manager.c"
		int i;
#line 56 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 56 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
			gitg_remote_manager_instead_of_destroy (&array[i]);
#line 159 "gitg-remote-manager.c"
		}
	}
#line 56 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_free (array);
#line 164 "gitg-remote-manager.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 61 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return self ? g_object_ref (self) : NULL;
#line 171 "gitg-remote-manager.c"
}


GitgRemoteManager* gitg_remote_manager_construct (GType object_type, GitgWindow* window) {
	GitgRemoteManager * self = NULL;
	GitgWindow* _tmp0_ = NULL;
	GitgWindow* _tmp1_ = NULL;
	GeeHashMap* _tmp2_ = NULL;
#line 59 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_return_val_if_fail (window != NULL, NULL);
#line 59 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self = (GitgRemoteManager*) g_object_new (object_type, NULL);
#line 61 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp0_ = window;
#line 61 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 61 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (self->priv->d_window);
#line 61 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv->d_window = _tmp1_;
#line 62 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, GITG_TYPE_REMOTE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 62 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (self->priv->d_remotes);
#line 62 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv->d_remotes = _tmp2_;
#line 64 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	gitg_remote_manager_extract_insteadof (self);
#line 59 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return self;
#line 202 "gitg-remote-manager.c"
}


GitgRemoteManager* gitg_remote_manager_new (GitgWindow* window) {
#line 59 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return gitg_remote_manager_construct (GITG_TYPE_REMOTE_MANAGER, window);
#line 209 "gitg-remote-manager.c"
}


static void _vala_array_add19 (GitgRemoteManagerInsteadOf** array, int* length, int* size, const GitgRemoteManagerInsteadOf* value) {
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if ((*length) == (*size)) {
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		*array = g_renew (GitgRemoteManagerInsteadOf, *array, *size);
#line 220 "gitg-remote-manager.c"
	}
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	(*array)[(*length)++] = *value;
#line 224 "gitg-remote-manager.c"
}


static gint ___lambda110_ (GitgRemoteManager* self, GMatchInfo* info, const gchar* value) {
	gint result = 0;
	GitgRemoteManagerInsteadOf* _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	GMatchInfo* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	GitgRemoteManagerInsteadOf _tmp5_ = {0};
#line 98 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_return_val_if_fail (info != NULL, 0);
#line 98 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_return_val_if_fail (value != NULL, 0);
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp0_ = self->priv->d_insteadof;
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp0__length1 = self->priv->d_insteadof_length1;
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp1_ = value;
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp3_ = info;
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp4_ = g_match_info_fetch (_tmp3_, 1);
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	memset (&_tmp5_, 0, sizeof (GitgRemoteManagerInsteadOf));
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_free0 (_tmp5_.prefix);
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp5_.prefix = _tmp2_;
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_free0 (_tmp5_.replacement);
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp5_.replacement = _tmp4_;
#line 99 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_vala_array_add19 (&self->priv->d_insteadof, &self->priv->d_insteadof_length1, &self->priv->_d_insteadof_size_, &_tmp5_);
#line 104 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	result = 0;
#line 104 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return result;
#line 269 "gitg-remote-manager.c"
}


static gint ____lambda110__ggit_config_match_callback (GMatchInfo* match_info, const gchar* value, gpointer self) {
	gint result;
	result = ___lambda110_ ((GitgRemoteManager*) self, match_info, value);
#line 98 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return result;
#line 278 "gitg-remote-manager.c"
}


static void gitg_remote_manager_extract_insteadof (GitgRemoteManager* self) {
	GitgRemoteManagerInsteadOf* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	GitgWindow* _tmp2_ = NULL;
	GitgRepository* _tmp3_ = NULL;
	GitgRepository* _tmp4_ = NULL;
	GitgRepository* _tmp5_ = NULL;
	gboolean _tmp6_ = FALSE;
	GgitConfig* config = NULL;
	GRegex* r = NULL;
	GError * _inner_error_ = NULL;
#line 67 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_return_if_fail (self != NULL);
#line 69 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp0_ = g_new0 (GitgRemoteManagerInsteadOf, 10);
#line 69 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv->d_insteadof = (_vala_GitgRemoteManagerInsteadOf_array_free (self->priv->d_insteadof, self->priv->d_insteadof_length1), NULL);
#line 69 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv->d_insteadof = _tmp0_;
#line 69 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv->d_insteadof_length1 = 10;
#line 69 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv->_d_insteadof_size_ = self->priv->d_insteadof_length1;
#line 70 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv->d_insteadof_length1 = 0;
#line 70 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp1_ = self->priv->d_insteadof_length1;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp2_ = self->priv->d_window;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp3_ = gitg_ext_application_get_repository ((GitgExtApplication*) _tmp2_);
#line 72 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp4_ = _tmp3_;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp5_ = _tmp4_;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp6_ = _tmp5_ == NULL;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (_tmp5_);
#line 72 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (_tmp6_) {
#line 74 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return;
#line 325 "gitg-remote-manager.c"
	}
	{
		GgitConfig* _tmp7_ = NULL;
		GitgWindow* _tmp8_ = NULL;
		GitgRepository* _tmp9_ = NULL;
		GitgRepository* _tmp10_ = NULL;
		GitgRepository* _tmp11_ = NULL;
		GgitConfig* _tmp12_ = NULL;
		GgitConfig* _tmp13_ = NULL;
		GgitConfig* _tmp14_ = NULL;
		GgitConfig* _tmp15_ = NULL;
		GgitConfig* _tmp16_ = NULL;
		GgitConfig* _tmp17_ = NULL;
		GgitConfig* _tmp18_ = NULL;
		GgitConfig* _tmp19_ = NULL;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp8_ = self->priv->d_window;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp9_ = gitg_ext_application_get_repository ((GitgExtApplication*) _tmp8_);
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp10_ = _tmp9_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp11_ = _tmp10_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp12_ = ggit_repository_get_config ((GgitRepository*) _tmp11_, &_inner_error_);
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp13_ = _tmp12_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (_tmp11_);
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp7_ = _tmp13_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 359 "gitg-remote-manager.c"
			goto __catch103_g_error;
		}
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp15_ = _tmp7_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp7_ = NULL;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp16_ = _tmp15_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp17_ = ggit_config_snapshot (_tmp16_, &_inner_error_);
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp18_ = _tmp17_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (_tmp16_);
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp14_ = _tmp18_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
			_g_object_unref0 (_tmp7_);
#line 380 "gitg-remote-manager.c"
			goto __catch103_g_error;
		}
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp19_ = _tmp14_;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp14_ = NULL;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (config);
#line 81 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		config = _tmp19_;
#line 79 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (_tmp14_);
#line 79 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (_tmp7_);
#line 395 "gitg-remote-manager.c"
	}
	goto __finally103;
	__catch103_g_error:
	{
#line 79 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_clear_error (&_inner_error_);
#line 79 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_inner_error_ = NULL;
#line 82 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (config);
#line 82 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return;
#line 408 "gitg-remote-manager.c"
	}
	__finally103:
#line 79 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 79 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (config);
#line 79 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 79 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_clear_error (&_inner_error_);
#line 79 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return;
#line 421 "gitg-remote-manager.c"
	}
	{
		GRegex* _tmp20_ = NULL;
		GRegex* _tmp21_ = NULL;
		GRegex* _tmp22_ = NULL;
#line 88 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp21_ = g_regex_new ("url\\.(.*)\\.insteadof", 0, 0, &_inner_error_);
#line 88 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp20_ = _tmp21_;
#line 88 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 433 "gitg-remote-manager.c"
			goto __catch104_g_error;
		}
#line 88 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp22_ = _tmp20_;
#line 88 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp20_ = NULL;
#line 88 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_regex_unref0 (r);
#line 88 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		r = _tmp22_;
#line 86 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_regex_unref0 (_tmp20_);
#line 446 "gitg-remote-manager.c"
	}
	goto __finally104;
	__catch104_g_error:
	{
		GError* e = NULL;
		FILE* _tmp23_ = NULL;
		GError* _tmp24_ = NULL;
		const gchar* _tmp25_ = NULL;
#line 86 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		e = _inner_error_;
#line 86 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_inner_error_ = NULL;
#line 92 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp23_ = stderr;
#line 92 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp24_ = e;
#line 92 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp25_ = _tmp24_->message;
#line 92 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		fprintf (_tmp23_, "Failed to compile regex: %s\n", _tmp25_);
#line 93 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_error_free0 (e);
#line 93 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_regex_unref0 (r);
#line 93 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (config);
#line 93 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return;
#line 475 "gitg-remote-manager.c"
	}
	__finally104:
#line 86 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 86 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_regex_unref0 (r);
#line 86 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (config);
#line 86 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 86 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_clear_error (&_inner_error_);
#line 86 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return;
#line 490 "gitg-remote-manager.c"
	}
	{
		GgitConfig* _tmp26_ = NULL;
		GRegex* _tmp27_ = NULL;
#line 98 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp26_ = config;
#line 98 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp27_ = r;
#line 98 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		ggit_config_match_foreach (_tmp26_, _tmp27_, ____lambda110__ggit_config_match_callback, self, &_inner_error_);
#line 98 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 503 "gitg-remote-manager.c"
			goto __catch105_g_error;
		}
	}
	goto __finally105;
	__catch105_g_error:
	{
#line 96 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_clear_error (&_inner_error_);
#line 96 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_inner_error_ = NULL;
#line 514 "gitg-remote-manager.c"
	}
	__finally105:
#line 96 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 96 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_regex_unref0 (r);
#line 96 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (config);
#line 96 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 96 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_clear_error (&_inner_error_);
#line 96 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return;
#line 529 "gitg-remote-manager.c"
	}
#line 67 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_regex_unref0 (r);
#line 67 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (config);
#line 535 "gitg-remote-manager.c"
}


static glong string_strnlen (gchar* str, glong maxlen) {
	glong result = 0L;
	gchar* end = NULL;
	gchar* _tmp0_ = NULL;
	glong _tmp1_ = 0L;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp0_ = str;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = maxlen;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	end = _tmp2_;
#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp3_ = end;
#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp3_ == NULL) {
#line 558 "gitg-remote-manager.c"
		glong _tmp4_ = 0L;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = maxlen;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = _tmp4_;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 566 "gitg-remote-manager.c"
	} else {
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = end;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = str;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = (glong) (_tmp5_ - _tmp6_);
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 578 "gitg-remote-manager.c"
	}
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	glong _tmp1_ = 0L;
	glong _tmp8_ = 0L;
	glong _tmp14_ = 0L;
	glong _tmp17_ = 0L;
	glong _tmp18_ = 0L;
	glong _tmp19_ = 0L;
	glong _tmp20_ = 0L;
	glong _tmp21_ = 0L;
	gchar* _tmp22_ = NULL;
#line 1306 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = offset;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp1_ >= ((glong) 0)) {
#line 602 "gitg-remote-manager.c"
		glong _tmp2_ = 0L;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp2_ = len;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = _tmp2_ >= ((glong) 0);
#line 608 "gitg-remote-manager.c"
	} else {
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = FALSE;
#line 612 "gitg-remote-manager.c"
	}
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 616 "gitg-remote-manager.c"
		glong _tmp3_ = 0L;
		glong _tmp4_ = 0L;
		glong _tmp5_ = 0L;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp3_ = offset;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = len;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_);
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		string_length = _tmp5_;
#line 628 "gitg-remote-manager.c"
	} else {
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = strlen (self);
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp7_ = _tmp6_;
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		string_length = (glong) _tmp7_;
#line 638 "gitg-remote-manager.c"
	}
#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp8_ = offset;
#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp8_ < ((glong) 0)) {
#line 644 "gitg-remote-manager.c"
		glong _tmp9_ = 0L;
		glong _tmp10_ = 0L;
		glong _tmp11_ = 0L;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp9_ = string_length;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp10_ = offset;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		offset = _tmp9_ + _tmp10_;
#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp11_ = offset;
#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL);
#line 658 "gitg-remote-manager.c"
	} else {
		glong _tmp12_ = 0L;
		glong _tmp13_ = 0L;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp12_ = offset;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp13_ = string_length;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL);
#line 668 "gitg-remote-manager.c"
	}
#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp14_ = len;
#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp14_ < ((glong) 0)) {
#line 674 "gitg-remote-manager.c"
		glong _tmp15_ = 0L;
		glong _tmp16_ = 0L;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp15_ = string_length;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp16_ = offset;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		len = _tmp15_ - _tmp16_;
#line 683 "gitg-remote-manager.c"
	}
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp17_ = offset;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp18_ = len;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp19_ = string_length;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL);
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp20_ = offset;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp21_ = len;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_);
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	result = _tmp22_;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	return result;
#line 703 "gitg-remote-manager.c"
}


static GitgRemote* gitg_remote_manager_real_lookup (GitgExtRemoteLookup* base, const gchar* name) {
	GitgRemoteManager * self;
	GitgRemote* result = NULL;
	GitgWindow* _tmp0_ = NULL;
	GitgRepository* _tmp1_ = NULL;
	GitgRepository* _tmp2_ = NULL;
	GitgRepository* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	GeeHashMap* _tmp5_ = NULL;
	GeeHashMap* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	GitgRemote* remote = NULL;
	gchar* url = NULL;
	GitgRemote* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	gchar* _tmp25_ = NULL;
	GitgRemoteManagerInsteadOf* _tmp26_ = NULL;
	gint _tmp26__length1 = 0;
	GitgRemote* _tmp68_ = NULL;
	GitgRemote* _tmp69_ = NULL;
	GitgWindow* _tmp70_ = NULL;
	GitgRemoteManagerUICredentialsProvider* _tmp71_ = NULL;
	GitgRemoteManagerUICredentialsProvider* _tmp72_ = NULL;
	GeeHashMap* _tmp73_ = NULL;
	const gchar* _tmp74_ = NULL;
	GitgRemote* _tmp75_ = NULL;
	GError * _inner_error_ = NULL;
#line 109 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self = (GitgRemoteManager*) base;
#line 109 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_return_val_if_fail (name != NULL, NULL);
#line 111 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp0_ = self->priv->d_window;
#line 111 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp1_ = gitg_ext_application_get_repository ((GitgExtApplication*) _tmp0_);
#line 111 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp2_ = _tmp1_;
#line 111 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp3_ = _tmp2_;
#line 111 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp4_ = _tmp3_ == NULL;
#line 111 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (_tmp3_);
#line 111 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (_tmp4_) {
#line 113 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		result = NULL;
#line 113 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return result;
#line 757 "gitg-remote-manager.c"
	}
#line 116 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp5_ = self->priv->d_remotes;
#line 116 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (_tmp5_ == NULL) {
#line 763 "gitg-remote-manager.c"
		GeeHashMap* _tmp6_ = NULL;
#line 118 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp6_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, GITG_TYPE_REMOTE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 118 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (self->priv->d_remotes);
#line 118 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		self->priv->d_remotes = _tmp6_;
#line 771 "gitg-remote-manager.c"
	}
#line 121 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp7_ = self->priv->d_remotes;
#line 121 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp8_ = name;
#line 121 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp9_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp7_, _tmp8_);
#line 121 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (_tmp9_) {
#line 781 "gitg-remote-manager.c"
		GeeHashMap* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		gpointer _tmp12_ = NULL;
#line 123 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp10_ = self->priv->d_remotes;
#line 123 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp11_ = name;
#line 123 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp12_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp10_, _tmp11_);
#line 123 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		result = (GitgRemote*) _tmp12_;
#line 123 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return result;
#line 795 "gitg-remote-manager.c"
	}
	{
		GgitRemote* _tmp13_ = NULL;
		GitgWindow* _tmp14_ = NULL;
		GitgRepository* _tmp15_ = NULL;
		GitgRepository* _tmp16_ = NULL;
		GitgRepository* _tmp17_ = NULL;
		const gchar* _tmp18_ = NULL;
		GgitRemote* _tmp19_ = NULL;
		GgitRemote* _tmp20_ = NULL;
		GgitRemote* _tmp21_ = NULL;
		GitgRemote* _tmp22_ = NULL;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp14_ = self->priv->d_window;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp15_ = gitg_ext_application_get_repository ((GitgExtApplication*) _tmp14_);
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp16_ = _tmp15_;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp17_ = _tmp16_;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp18_ = name;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp19_ = ggit_repository_lookup_remote ((GgitRepository*) _tmp17_, _tmp18_, &_inner_error_);
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp20_ = _tmp19_;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (_tmp17_);
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp13_ = _tmp20_;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 828 "gitg-remote-manager.c"
			goto __catch106_g_error;
		}
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp21_ = _tmp13_;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp13_ = NULL;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp22_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, GITG_TYPE_REMOTE) ? ((GitgRemote*) _tmp21_) : NULL;
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		if (_tmp22_ == NULL) {
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
			_g_object_unref0 (_tmp21_);
#line 841 "gitg-remote-manager.c"
		}
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (remote);
#line 130 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		remote = _tmp22_;
#line 128 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (_tmp13_);
#line 849 "gitg-remote-manager.c"
	}
	goto __finally106;
	__catch106_g_error:
	{
#line 128 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_clear_error (&_inner_error_);
#line 128 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_inner_error_ = NULL;
#line 131 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		result = NULL;
#line 131 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (remote);
#line 131 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return result;
#line 864 "gitg-remote-manager.c"
	}
	__finally106:
#line 128 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 128 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (remote);
#line 128 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 128 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_clear_error (&_inner_error_);
#line 128 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return NULL;
#line 877 "gitg-remote-manager.c"
	}
#line 133 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp23_ = remote;
#line 133 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp24_ = ggit_remote_get_url ((GgitRemote*) _tmp23_);
#line 133 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp25_ = g_strdup (_tmp24_);
#line 133 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	url = _tmp25_;
#line 135 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp26_ = self->priv->d_insteadof;
#line 135 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp26__length1 = self->priv->d_insteadof_length1;
#line 891 "gitg-remote-manager.c"
	{
		GitgRemoteManagerInsteadOf* io_collection = NULL;
		gint io_collection_length1 = 0;
		gint _io_collection_size_ = 0;
		gint io_it = 0;
#line 135 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		io_collection = _tmp26_;
#line 135 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		io_collection_length1 = _tmp26__length1;
#line 135 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		for (io_it = 0; io_it < _tmp26__length1; io_it = io_it + 1) {
#line 903 "gitg-remote-manager.c"
			GitgRemoteManagerInsteadOf _tmp27_ = {0};
			GitgRemoteManagerInsteadOf io = {0};
#line 135 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
			gitg_remote_manager_instead_of_copy (&io_collection[io_it], &_tmp27_);
#line 135 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
			io = _tmp27_;
#line 910 "gitg-remote-manager.c"
			{
				const gchar* _tmp28_ = NULL;
				GitgRemoteManagerInsteadOf _tmp29_ = {0};
				const gchar* _tmp30_ = NULL;
				gboolean _tmp31_ = FALSE;
#line 137 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
				_tmp28_ = url;
#line 137 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
				_tmp29_ = io;
#line 137 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
				_tmp30_ = _tmp29_.prefix;
#line 137 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
				_tmp31_ = g_str_has_prefix (_tmp28_, _tmp30_);
#line 137 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
				if (_tmp31_) {
#line 926 "gitg-remote-manager.c"
					GitgRemoteManagerInsteadOf _tmp32_ = {0};
					const gchar* _tmp33_ = NULL;
					const gchar* _tmp34_ = NULL;
					GitgRemoteManagerInsteadOf _tmp35_ = {0};
					const gchar* _tmp36_ = NULL;
					gint _tmp37_ = 0;
					gint _tmp38_ = 0;
					gchar* _tmp39_ = NULL;
					gchar* _tmp40_ = NULL;
					gchar* _tmp41_ = NULL;
					gchar** fetch_specs = NULL;
					gint fetch_specs_length1 = 0;
					gint _fetch_specs_size_ = 0;
					gchar** push_specs = NULL;
					gint push_specs_length1 = 0;
					gint _push_specs_size_ = 0;
					GitgRemote* _tmp42_ = NULL;
					gchar** _tmp43_ = NULL;
					gint _tmp43__length1 = 0;
					gchar** _tmp44_ = NULL;
					gint _tmp44__length1 = 0;
					GitgRemote* _tmp45_ = NULL;
					gchar** _tmp46_ = NULL;
					gint _tmp46__length1 = 0;
					gchar** _tmp47_ = NULL;
					gint _tmp47__length1 = 0;
					GitgRemote* tmp = NULL;
					GitgRemote* _tmp61_ = NULL;
					GitgRemote* _tmp62_ = NULL;
					gchar** _tmp63_ = NULL;
					gint _tmp63__length1 = 0;
					GitgRemote* _tmp64_ = NULL;
					gchar** _tmp65_ = NULL;
					gint _tmp65__length1 = 0;
					GitgRemote* _tmp66_ = NULL;
					GitgRemote* _tmp67_ = NULL;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp32_ = io;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp33_ = _tmp32_.replacement;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp34_ = url;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp35_ = io;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp36_ = _tmp35_.prefix;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp37_ = strlen (_tmp36_);
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp38_ = _tmp37_;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp39_ = string_substring (_tmp34_, (glong) _tmp38_, (glong) -1);
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp40_ = _tmp39_;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp41_ = g_strconcat (_tmp33_, _tmp40_, NULL);
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_g_free0 (url);
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					url = _tmp41_;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_g_free0 (_tmp40_);
#line 144 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp42_ = remote;
#line 144 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp43_ = gitg_remote_get_fetch_specs (_tmp42_, &_tmp43__length1);
#line 144 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp44_ = _tmp43_;
#line 144 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp44__length1 = _tmp43__length1;
#line 144 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					fetch_specs = (_vala_array_free (fetch_specs, fetch_specs_length1, (GDestroyNotify) g_free), NULL);
#line 144 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					fetch_specs = _tmp44_;
#line 144 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					fetch_specs_length1 = _tmp44__length1;
#line 144 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_fetch_specs_size_ = fetch_specs_length1;
#line 145 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp45_ = remote;
#line 145 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp46_ = gitg_remote_get_push_specs (_tmp45_, &_tmp46__length1);
#line 145 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp47_ = _tmp46_;
#line 145 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp47__length1 = _tmp46__length1;
#line 145 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					push_specs = (_vala_array_free (push_specs, push_specs_length1, (GDestroyNotify) g_free), NULL);
#line 145 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					push_specs = _tmp47_;
#line 145 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					push_specs_length1 = _tmp47__length1;
#line 145 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_push_specs_size_ = push_specs_length1;
#line 147 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					tmp = NULL;
#line 1023 "gitg-remote-manager.c"
					{
						GgitRemote* _tmp48_ = NULL;
						GitgWindow* _tmp49_ = NULL;
						GitgRepository* _tmp50_ = NULL;
						GitgRepository* _tmp51_ = NULL;
						GitgRepository* _tmp52_ = NULL;
						const gchar* _tmp53_ = NULL;
						GgitRemote* _tmp54_ = NULL;
						GgitRemote* _tmp55_ = NULL;
						GgitRemote* _tmp56_ = NULL;
						GitgRemote* _tmp57_ = NULL;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp49_ = self->priv->d_window;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp50_ = gitg_ext_application_get_repository ((GitgExtApplication*) _tmp49_);
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp51_ = _tmp50_;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp52_ = _tmp51_;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp53_ = url;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp54_ = ggit_remote_new_anonymous ((GgitRepository*) _tmp52_, _tmp53_, &_inner_error_);
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp55_ = _tmp54_;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_g_object_unref0 (_tmp52_);
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp48_ = _tmp55_;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1055 "gitg-remote-manager.c"
							goto __catch107_g_error;
						}
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp56_ = _tmp48_;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp48_ = NULL;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp57_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp56_, GITG_TYPE_REMOTE) ? ((GitgRemote*) _tmp56_) : NULL;
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						if (_tmp57_ == NULL) {
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
							_g_object_unref0 (_tmp56_);
#line 1068 "gitg-remote-manager.c"
						}
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_g_object_unref0 (tmp);
#line 151 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						tmp = _tmp57_;
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_g_object_unref0 (_tmp48_);
#line 1076 "gitg-remote-manager.c"
					}
					goto __finally107;
					__catch107_g_error:
					{
						GError* e = NULL;
						FILE* _tmp58_ = NULL;
						GError* _tmp59_ = NULL;
						const gchar* _tmp60_ = NULL;
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						e = _inner_error_;
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_inner_error_ = NULL;
#line 155 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp58_ = stderr;
#line 155 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp59_ = e;
#line 155 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_tmp60_ = _tmp59_->message;
#line 155 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						fprintf (_tmp58_, "Failed to create remote: %s\n", _tmp60_);
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_g_error_free0 (e);
#line 1099 "gitg-remote-manager.c"
					}
					__finally107:
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_g_object_unref0 (tmp);
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						push_specs = (_vala_array_free (push_specs, push_specs_length1, (GDestroyNotify) g_free), NULL);
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						fetch_specs = (_vala_array_free (fetch_specs, fetch_specs_length1, (GDestroyNotify) g_free), NULL);
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						gitg_remote_manager_instead_of_destroy (&io);
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_g_free0 (url);
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_g_object_unref0 (remote);
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						g_clear_error (&_inner_error_);
#line 149 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						return NULL;
#line 1122 "gitg-remote-manager.c"
					}
#line 158 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp61_ = tmp;
#line 158 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					if (_tmp61_ == NULL) {
#line 160 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						_g_object_unref0 (tmp);
#line 160 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						push_specs = (_vala_array_free (push_specs, push_specs_length1, (GDestroyNotify) g_free), NULL);
#line 160 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						fetch_specs = (_vala_array_free (fetch_specs, fetch_specs_length1, (GDestroyNotify) g_free), NULL);
#line 160 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						gitg_remote_manager_instead_of_destroy (&io);
#line 160 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
						break;
#line 1138 "gitg-remote-manager.c"
					}
#line 163 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp62_ = tmp;
#line 163 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp63_ = fetch_specs;
#line 163 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp63__length1 = fetch_specs_length1;
#line 163 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					gitg_remote_set_fetch_specs (_tmp62_, _tmp63_, _tmp63__length1);
#line 164 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp64_ = tmp;
#line 164 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp65_ = push_specs;
#line 164 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp65__length1 = push_specs_length1;
#line 164 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					gitg_remote_set_push_specs (_tmp64_, _tmp65_, _tmp65__length1);
#line 166 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp66_ = tmp;
#line 166 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_tmp67_ = _g_object_ref0 (_tmp66_);
#line 166 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_g_object_unref0 (remote);
#line 166 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					remote = _tmp67_;
#line 167 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					_g_object_unref0 (tmp);
#line 167 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					push_specs = (_vala_array_free (push_specs, push_specs_length1, (GDestroyNotify) g_free), NULL);
#line 167 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					fetch_specs = (_vala_array_free (fetch_specs, fetch_specs_length1, (GDestroyNotify) g_free), NULL);
#line 167 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					gitg_remote_manager_instead_of_destroy (&io);
#line 167 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
					break;
#line 1174 "gitg-remote-manager.c"
				}
#line 135 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
				gitg_remote_manager_instead_of_destroy (&io);
#line 1178 "gitg-remote-manager.c"
			}
		}
	}
#line 171 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp68_ = remote;
#line 171 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp69_ = remote;
#line 171 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp70_ = self->priv->d_window;
#line 171 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp71_ = gitg_remote_manager_ui_credentials_provider_new (_tmp69_, (GtkWindow*) _tmp70_);
#line 171 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp72_ = _tmp71_;
#line 171 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	gitg_remote_set_credentials_provider (_tmp68_, (GitgCredentialsProvider*) _tmp72_);
#line 171 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (_tmp72_);
#line 173 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp73_ = self->priv->d_remotes;
#line 173 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp74_ = name;
#line 173 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp75_ = remote;
#line 173 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	gee_abstract_map_set ((GeeAbstractMap*) _tmp73_, _tmp74_, _tmp75_);
#line 174 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	result = remote;
#line 174 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_free0 (url);
#line 174 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return result;
#line 1210 "gitg-remote-manager.c"
}


static GitgRemoteManagerUICredentialsProvider* gitg_remote_manager_ui_credentials_provider_construct (GType object_type, GitgRemote* remote, GtkWindow* window) {
	GitgRemoteManagerUICredentialsProvider * self = NULL;
	GgitConfig* config = NULL;
	GgitConfig* _tmp7_ = NULL;
	GtkWindow* _tmp8_ = NULL;
	GitgCredentialsManager* _tmp9_ = NULL;
	GError * _inner_error_ = NULL;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_return_val_if_fail (remote != NULL, NULL);
#line 29 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_return_val_if_fail (window != NULL, NULL);
#line 29 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self = (GitgRemoteManagerUICredentialsProvider*) g_object_new (object_type, NULL);
#line 31 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	config = NULL;
#line 1229 "gitg-remote-manager.c"
	{
		GgitConfig* _tmp0_ = NULL;
		GitgRemote* _tmp1_ = NULL;
		GgitRepository* _tmp2_ = NULL;
		GgitRepository* _tmp3_ = NULL;
		GgitConfig* _tmp4_ = NULL;
		GgitConfig* _tmp5_ = NULL;
		GgitConfig* _tmp6_ = NULL;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp1_ = remote;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp2_ = ggit_remote_get_owner ((GgitRemote*) _tmp1_);
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp3_ = _tmp2_;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp4_ = ggit_repository_get_config (_tmp3_, &_inner_error_);
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp5_ = _tmp4_;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (_tmp3_);
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp0_ = _tmp5_;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1254 "gitg-remote-manager.c"
			goto __catch108_g_error;
		}
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp6_ = _tmp0_;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_tmp0_ = NULL;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (config);
#line 35 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		config = _tmp6_;
#line 33 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (_tmp0_);
#line 1267 "gitg-remote-manager.c"
	}
	goto __finally108;
	__catch108_g_error:
	{
#line 33 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_clear_error (&_inner_error_);
#line 33 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_inner_error_ = NULL;
#line 1276 "gitg-remote-manager.c"
	}
	__finally108:
#line 33 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 33 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		_g_object_unref0 (config);
#line 33 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 33 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_clear_error (&_inner_error_);
#line 33 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return NULL;
#line 1289 "gitg-remote-manager.c"
	}
#line 38 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp7_ = config;
#line 38 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp8_ = window;
#line 38 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp9_ = gitg_credentials_manager_new (_tmp7_, _tmp8_, TRUE);
#line 38 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_gitg_credentials_manager_unref0 (self->priv->d_credentials);
#line 38 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv->d_credentials = _tmp9_;
#line 29 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (config);
#line 29 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return self;
#line 1305 "gitg-remote-manager.c"
}


static GitgRemoteManagerUICredentialsProvider* gitg_remote_manager_ui_credentials_provider_new (GitgRemote* remote, GtkWindow* window) {
#line 29 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return gitg_remote_manager_ui_credentials_provider_construct (GITG_REMOTE_MANAGER_TYPE_UI_CREDENTIALS_PROVIDER, remote, window);
#line 1312 "gitg-remote-manager.c"
}


static GgitCred* gitg_remote_manager_ui_credentials_provider_real_credentials (GitgCredentialsProvider* base, const gchar* url, const gchar* username_from_url, GgitCredtype allowed_types, GError** error) {
	GitgRemoteManagerUICredentialsProvider * self;
	GgitCred* result = NULL;
	GgitCred* _tmp0_ = NULL;
	GitgCredentialsManager* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GgitCredtype _tmp4_ = 0;
	GgitCred* _tmp5_ = NULL;
	GgitCred* _tmp6_ = NULL;
	GError * _inner_error_ = NULL;
#line 41 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self = (GitgRemoteManagerUICredentialsProvider*) base;
#line 41 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_return_val_if_fail (url != NULL, NULL);
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp1_ = self->priv->d_credentials;
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp2_ = url;
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp3_ = username_from_url;
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp4_ = allowed_types;
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp5_ = gitg_credentials_manager_credentials (_tmp1_, _tmp2_, _tmp3_, _tmp4_, &_inner_error_);
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp0_ = _tmp5_;
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		g_propagate_error (error, _inner_error_);
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
		return NULL;
#line 1349 "gitg-remote-manager.c"
	}
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp6_ = _tmp0_;
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp0_ = NULL;
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	result = _tmp6_;
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (_tmp0_);
#line 45 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return result;
#line 1361 "gitg-remote-manager.c"
}


static void gitg_remote_manager_ui_credentials_provider_class_init (GitgRemoteManagerUICredentialsProviderClass * klass) {
#line 25 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	gitg_remote_manager_ui_credentials_provider_parent_class = g_type_class_peek_parent (klass);
#line 25 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_type_class_add_private (klass, sizeof (GitgRemoteManagerUICredentialsProviderPrivate));
#line 25 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	G_OBJECT_CLASS (klass)->finalize = gitg_remote_manager_ui_credentials_provider_finalize;
#line 1372 "gitg-remote-manager.c"
}


static void gitg_remote_manager_ui_credentials_provider_gitg_credentials_provider_interface_init (GitgCredentialsProviderIface * iface) {
#line 25 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	gitg_remote_manager_ui_credentials_provider_gitg_credentials_provider_parent_iface = g_type_interface_peek_parent (iface);
#line 25 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	iface->credentials = (GgitCred* (*)(GitgCredentialsProvider*, const gchar*, const gchar*, GgitCredtype, GError**)) gitg_remote_manager_ui_credentials_provider_real_credentials;
#line 1381 "gitg-remote-manager.c"
}


static void gitg_remote_manager_ui_credentials_provider_instance_init (GitgRemoteManagerUICredentialsProvider * self) {
#line 25 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv = GITG_REMOTE_MANAGER_UI_CREDENTIALS_PROVIDER_GET_PRIVATE (self);
#line 1388 "gitg-remote-manager.c"
}


static void gitg_remote_manager_ui_credentials_provider_finalize (GObject* obj) {
	GitgRemoteManagerUICredentialsProvider * self;
#line 25 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_REMOTE_MANAGER_TYPE_UI_CREDENTIALS_PROVIDER, GitgRemoteManagerUICredentialsProvider);
#line 27 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_gitg_credentials_manager_unref0 (self->priv->d_credentials);
#line 25 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	G_OBJECT_CLASS (gitg_remote_manager_ui_credentials_provider_parent_class)->finalize (obj);
#line 1400 "gitg-remote-manager.c"
}


static GType gitg_remote_manager_ui_credentials_provider_get_type (void) {
	static volatile gsize gitg_remote_manager_ui_credentials_provider_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_remote_manager_ui_credentials_provider_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GitgRemoteManagerUICredentialsProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_remote_manager_ui_credentials_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgRemoteManagerUICredentialsProvider), 0, (GInstanceInitFunc) gitg_remote_manager_ui_credentials_provider_instance_init, NULL };
		static const GInterfaceInfo gitg_credentials_provider_info = { (GInterfaceInitFunc) gitg_remote_manager_ui_credentials_provider_gitg_credentials_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gitg_remote_manager_ui_credentials_provider_type_id;
		gitg_remote_manager_ui_credentials_provider_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgRemoteManagerUICredentialsProvider", &g_define_type_info, 0);
		g_type_add_interface_static (gitg_remote_manager_ui_credentials_provider_type_id, GITG_TYPE_CREDENTIALS_PROVIDER, &gitg_credentials_provider_info);
		g_once_init_leave (&gitg_remote_manager_ui_credentials_provider_type_id__volatile, gitg_remote_manager_ui_credentials_provider_type_id);
	}
	return gitg_remote_manager_ui_credentials_provider_type_id__volatile;
}


static void gitg_remote_manager_instead_of_copy (const GitgRemoteManagerInsteadOf* self, GitgRemoteManagerInsteadOf* dest) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp0_ = (*self).prefix;
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_free0 ((*dest).prefix);
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	(*dest).prefix = _tmp1_;
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp2_ = (*self).replacement;
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_tmp3_ = g_strdup (_tmp2_);
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_free0 ((*dest).replacement);
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	(*dest).replacement = _tmp3_;
#line 1439 "gitg-remote-manager.c"
}


static void gitg_remote_manager_instead_of_destroy (GitgRemoteManagerInsteadOf* self) {
#line 51 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_free0 ((*self).prefix);
#line 52 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_free0 ((*self).replacement);
#line 1448 "gitg-remote-manager.c"
}


static GitgRemoteManagerInsteadOf* gitg_remote_manager_instead_of_dup (const GitgRemoteManagerInsteadOf* self) {
	GitgRemoteManagerInsteadOf* dup;
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	dup = g_new0 (GitgRemoteManagerInsteadOf, 1);
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	gitg_remote_manager_instead_of_copy (self, dup);
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	return dup;
#line 1460 "gitg-remote-manager.c"
}


static void gitg_remote_manager_instead_of_free (GitgRemoteManagerInsteadOf* self) {
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	gitg_remote_manager_instead_of_destroy (self);
#line 49 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_free (self);
#line 1469 "gitg-remote-manager.c"
}


static GType gitg_remote_manager_instead_of_get_type (void) {
	static volatile gsize gitg_remote_manager_instead_of_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_remote_manager_instead_of_type_id__volatile)) {
		GType gitg_remote_manager_instead_of_type_id;
		gitg_remote_manager_instead_of_type_id = g_boxed_type_register_static ("GitgRemoteManagerInsteadOf", (GBoxedCopyFunc) gitg_remote_manager_instead_of_dup, (GBoxedFreeFunc) gitg_remote_manager_instead_of_free);
		g_once_init_leave (&gitg_remote_manager_instead_of_type_id__volatile, gitg_remote_manager_instead_of_type_id);
	}
	return gitg_remote_manager_instead_of_type_id__volatile;
}


static void gitg_remote_manager_class_init (GitgRemoteManagerClass * klass) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	gitg_remote_manager_parent_class = g_type_class_peek_parent (klass);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	g_type_class_add_private (klass, sizeof (GitgRemoteManagerPrivate));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	G_OBJECT_CLASS (klass)->finalize = gitg_remote_manager_finalize;
#line 1491 "gitg-remote-manager.c"
}


static void gitg_remote_manager_gitg_ext_remote_lookup_interface_init (GitgExtRemoteLookupIface * iface) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	gitg_remote_manager_gitg_ext_remote_lookup_parent_iface = g_type_interface_peek_parent (iface);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	iface->lookup = (GitgRemote* (*)(GitgExtRemoteLookup*, const gchar*)) gitg_remote_manager_real_lookup;
#line 1500 "gitg-remote-manager.c"
}


static void gitg_remote_manager_instance_init (GitgRemoteManager * self) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv = GITG_REMOTE_MANAGER_GET_PRIVATE (self);
#line 1507 "gitg-remote-manager.c"
}


static void gitg_remote_manager_finalize (GObject* obj) {
	GitgRemoteManager * self;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_REMOTE_MANAGER, GitgRemoteManager);
#line 55 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (self->priv->d_remotes);
#line 56 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	self->priv->d_insteadof = (_vala_GitgRemoteManagerInsteadOf_array_free (self->priv->d_insteadof, self->priv->d_insteadof_length1), NULL);
#line 57 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	_g_object_unref0 (self->priv->d_window);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-remote-manager.vala"
	G_OBJECT_CLASS (gitg_remote_manager_parent_class)->finalize (obj);
#line 1523 "gitg-remote-manager.c"
}


GType gitg_remote_manager_get_type (void) {
	static volatile gsize gitg_remote_manager_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_remote_manager_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GitgRemoteManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_remote_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgRemoteManager), 0, (GInstanceInitFunc) gitg_remote_manager_instance_init, NULL };
		static const GInterfaceInfo gitg_ext_remote_lookup_info = { (GInterfaceInitFunc) gitg_remote_manager_gitg_ext_remote_lookup_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gitg_remote_manager_type_id;
		gitg_remote_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgRemoteManager", &g_define_type_info, 0);
		g_type_add_interface_static (gitg_remote_manager_type_id, GITG_EXT_TYPE_REMOTE_LOOKUP, &gitg_ext_remote_lookup_info);
		g_once_init_leave (&gitg_remote_manager_type_id__volatile, gitg_remote_manager_type_id);
	}
	return gitg_remote_manager_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



