summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2007-01-21 18:00:03 -0500
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2007-01-21 22:47:59 -0500
commitf5925d934fdd1ffc3ded7272ea278437608f5f50 (patch)
tree2f2b301e42ebd10a3442814fadb9273d232447ba
parentgit-gui: Slightly tweak new window geometry. (diff)
downloadtgif-f5925d934fdd1ffc3ded7272ea278437608f5f50.tar.xz
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>
-rwxr-xr-xgit-gui.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 7115cb5d05..d71fcd8220 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -997,7 +997,7 @@ proc commit_writetree {curHEAD msg} {
proc commit_committree {fd_wt curHEAD msg} {
global HEAD PARENT MERGE_HEAD commit_type
- global single_commit
+ global single_commit all_heads current_branch
global ui_status_value ui_comm selected_commit_type
global file_states selected_paths rescan_active
@@ -1049,6 +1049,14 @@ proc commit_committree {fd_wt curHEAD msg} {
return
}
+ # -- Make sure our current branch exists.
+ #
+ if {$commit_type eq {initial}} {
+ lappend all_heads $current_branch
+ set all_heads [lsort -unique $all_heads]
+ populate_branch_menu
+ }
+
# -- Cleanup after ourselves.
#
catch {file delete [gitdir MERGE_HEAD]}