mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-31 04:58:58 +00:00
Fixed warnings and notification for unfound git repository
This commit is contained in:
parent
65ff024847
commit
9270470147
2 changed files with 17 additions and 3 deletions
|
@ -357,8 +357,11 @@ gitg_revision_view_finalize(GObject *object)
|
|||
|
||||
gitg_runner_cancel(self->priv->diff_files_runner);
|
||||
g_object_unref(self->priv->diff_files_runner);
|
||||
|
||||
g_object_unref(self->priv->repository);
|
||||
|
||||
if (self->priv->repository)
|
||||
{
|
||||
g_object_unref(self->priv->repository);
|
||||
}
|
||||
|
||||
free_cached_headers(self);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue