[anjuta] git: Check that there are branches in the repository when merging or switching branches
- From: James Liggett <jrliggett src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjuta] git: Check that there are branches in the repository when merging or switching branches
- Date: Wed, 29 Jul 2009 02:04:10 +0000 (UTC)
commit ea812704c12b7c5f5366c9706ac6290a9ac34277
Author: James Liggett <jrliggett cox net>
Date: Tue Jul 28 19:00:43 2009 -0700
git: Check that there are branches in the repository when merging or switching branches
plugins/git/git-merge-dialog.c | 4 ++++
plugins/git/git-switch-dialog.c | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/plugins/git/git-merge-dialog.c b/plugins/git/git-merge-dialog.c
index fff0cf4..0bb3ce3 100644
--- a/plugins/git/git-merge-dialog.c
+++ b/plugins/git/git-merge-dialog.c
@@ -72,6 +72,10 @@ on_merge_dialog_response (GtkDialog *dialog, gint response_id,
"merge_log_view"));
branch_combo_model = GTK_TREE_MODEL (gtk_builder_get_object (data->bxml,
"branch_combo_model"));
+
+ if (!git_check_branches (GTK_COMBO_BOX (merge_branch_combo)))
+ return;
+
log = NULL;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (use_custom_log_check)))
diff --git a/plugins/git/git-switch-dialog.c b/plugins/git/git-switch-dialog.c
index d1fdb30..8b76f71 100644
--- a/plugins/git/git-switch-dialog.c
+++ b/plugins/git/git-switch-dialog.c
@@ -58,6 +58,9 @@ on_switch_dialog_response (GtkDialog *dialog, gint response_id,
branch_combo_model = GTK_TREE_MODEL (gtk_builder_get_object (data->bxml,
"branch_combo_model"));
+ if (!git_check_branches (GTK_COMBO_BOX (merge_branch_combo)))
+ return;
+
gtk_combo_box_get_active_iter (GTK_COMBO_BOX (switch_branch_combo), &iter);
gtk_tree_model_get (branch_combo_model, &iter, 0, &branch, -1);
@@ -65,8 +68,6 @@ on_switch_dialog_response (GtkDialog *dialog, gint response_id,
checkout_command = git_branch_checkout_command_new (data->plugin->project_root_directory,
branch);
-
-
g_free (branch);
git_create_message_view (data->plugin);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]