Fixed warnings and notification for unfound git repository

This commit is contained in:
Jesse van den Kieboom 2009-08-29 12:19:54 +02:00
parent 65ff024847
commit 9270470147
2 changed files with 17 additions and 3 deletions

View file

@ -358,7 +358,10 @@ gitg_revision_view_finalize(GObject *object)
gitg_runner_cancel(self->priv->diff_files_runner);
g_object_unref(self->priv->diff_files_runner);
if (self->priv->repository)
{
g_object_unref(self->priv->repository);
}
free_cached_headers(self);

View file

@ -845,6 +845,15 @@ create_repository(GitgWindow *window, gchar const *path, gboolean usewd)
gchar *curdir = g_get_current_dir();
window->priv->repository = gitg_repository_new(curdir);
g_free(curdir);
if (!gitg_repository_get_path (window->priv->repository))
{
g_object_unref (window->priv->repository);
window->priv->repository = NULL;
ret = FALSE;
path = NULL;
}
}
return ret;
@ -1124,8 +1133,10 @@ load_repository(GitgWindow *window, gchar const *path, gint argc, gchar const **
gitg_commit_view_set_repository(window->priv->commit_view, window->priv->repository);
gitg_revision_view_set_repository(window->priv->revision_view, window->priv->repository);
if (path || argc > 1)
if (path || argc > 1 || usewd)
{
handle_no_gitdir(window);
}
update_window_title (window);
gtk_widget_set_sensitive(GTK_WIDGET(window->priv->notebook_main), FALSE);