git-gui: Create missing branch head on initial commit.
If we are making an initial commit our branch head did not exist when we scanned for all heads during startup. Consequently we won't have it in our branch menu. So force it to be put there after the ref was created. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 21, 2007 at 18:00 UTC
f5925d934fdd1ffc3ded7272ea278437608f5f50
1 file changed
+9
-1
git-gui.sh
+9
-1
@@ -997,7 +997,7 @@ proc commit_writetree {curHEAD msg} {
997
998
proc commit_committree {fd_wt curHEAD msg} {
999
global HEAD PARENT MERGE_HEAD commit_type
1000
- global single_commit
1000
+ global single_commit all_heads current_branch
1001
global ui_status_value ui_comm selected_commit_type
1002
global file_states selected_paths rescan_active
1003
@@ -1049,6 +1049,14 @@ proc commit_committree {fd_wt curHEAD msg} {
1049
return
1050
}
1051
1052
+ # -- Make sure our current branch exists.
1053
+ #
1054
+ if {$commit_type eq {initial}} {
1055
+ lappend all_heads $current_branch
1056
+ set all_heads [lsort -unique $all_heads]
1057
+ populate_branch_menu
1058
+ }
1059
+
1060
# -- Cleanup after ourselves.
1061
#
1062
catch {file delete [gitdir MERGE_HEAD]}