@matheusbsbs / matheus-bagliano / commits / e21594a998
Fork 0

git-gui: Attempt to checkout the new branch after creation.

If the user asked us to checkout the branch after creating it then we should try to do so. This may fail, especially right now since branch switching from within git-gui is not supported. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Jan 21, 2007 at 04:57 UTC e21594a998d71eff39d80af878162abe94ef6e17
1 file changed +4 -3
git-gui.sh
+4 -3
@@ -1674,6 +1674,9 @@ proc do_create_branch_action {w} {
1674 set all_heads [lsort $all_heads]
1675 populate_branch_menu
1676 destroy $w
1677 + if {$create_branch_checkout} {
1678 + switch_branch $newbranch
1679 + }
1680 }
1681
1682 proc do_create_branch {} {
@@ -1681,7 +1684,7 @@ proc do_create_branch {} {
1684 global create_branch_checkout create_branch_revtype
1685 global create_branch_head create_branch_trackinghead
1686
1684 - set create_branch_checkout true
1687 + set create_branch_checkout 1
1688 set create_branch_revtype head
1689 set create_branch_head $current_branch
1690 set create_branch_trackinghead {}
@@ -1792,8 +1795,6 @@ proc do_create_branch {} {
1795 -font font_ui
1796 checkbutton $w.postActions.checkout \
1797 -text {Checkout after creation} \
1795 - -offvalue false \
1796 - -onvalue true \
1798 -variable create_branch_checkout \
1799 -font font_ui
1800 pack $w.postActions.checkout -anchor nw