git-gui: Don't format the mode line of a diff.
[gitweb.git] / git-gui.sh
index 7115cb5d0559972d152c53b39bfabc2aca5369ad..396a44e65455db98783026c5806bcb00c12c4232 100755 (executable)
@@ -709,6 +709,7 @@ proc read_diff {fd} {
                if {[string match {@@@ *} $line]} {set is_3way_diff 1}
 
                if {[string match {index *} $line]
+                       || [string match {mode *} $line]
                        || [regexp {^\* Unmerged path } $line]} {
                        set tags {}
                } elseif {$is_3way_diff} {
@@ -997,7 +998,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 +1050,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]}