@@ -1267,6 +1267,24 @@ proc commit_committree {fd_wt curHEAD msg} {
1267
1267
return
1268
1268
}
1269
1269
1270
+ # -- Verify this wasn't an empty change.
1271
+ #
1272
+ if {$commit_type eq {normal}} {
1273
+ set old_tree [git rev-parse " $PARENT ^{tree}" ]
1274
+ if {$tree_id eq $old_tree } {
1275
+ info_popup {No changes to commit.
1276
+
1277
+ No files were modified by this commit and it
1278
+ was not a merge commit.
1279
+
1280
+ A rescan will be automatically started now.
1281
+ }
1282
+ unlock_index
1283
+ rescan {set ui_status_value {No changes to commit.}}
1284
+ return
1285
+ }
1286
+ }
1287
+
1270
1288
# -- Build the message.
1271
1289
#
1272
1290
set msg_p [gitdir COMMIT_EDITMSG]
@@ -1281,14 +1299,8 @@ proc commit_committree {fd_wt curHEAD msg} {
1281
1299
# -- Create the commit.
1282
1300
#
1283
1301
set cmd [list git commit-tree $tree_id ]
1284
- set parents [concat $PARENT $MERGE_HEAD ]
1285
- if {[llength $parents ] > 0} {
1286
- foreach p $parents {
1287
- lappend cmd -p $p
1288
- }
1289
- } else {
1290
- # git commit-tree writes to stderr during initial commit.
1291
- lappend cmd 2>/dev/null
1302
+ foreach p [concat $PARENT $MERGE_HEAD ] {
1303
+ lappend cmd -p $p
1292
1304
}
1293
1305
lappend cmd <$msg_p
1294
1306
if {[catch {set cmt_id [eval exec $cmd ]} err]} {
@@ -5256,6 +5268,12 @@ if {[is_enabled branch]} {
5256
5268
-font font_ui
5257
5269
lappend disable_on_lock [list .mbar.branch entryconf \
5258
5270
[.mbar.branch index last] -state]
5271
+
5272
+ .mbar.branch add command -label {Reset...} \
5273
+ -command do_reset_hard \
5274
+ -font font_ui
5275
+ lappend disable_on_lock [list .mbar.branch entryconf \
5276
+ [.mbar.branch index last] -state]
5259
5277
}
5260
5278
5261
5279
# -- Commit Menu
@@ -5330,6 +5348,34 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
5330
5348
[list .mbar.commit entryconf [.mbar.commit index last] -state]
5331
5349
}
5332
5350
5351
+ # -- Merge Menu
5352
+ #
5353
+ if {[is_enabled branch]} {
5354
+ menu .mbar.merge
5355
+ .mbar.merge add command -label {Local Merge...} \
5356
+ -command do_local_merge \
5357
+ -font font_ui
5358
+ lappend disable_on_lock \
5359
+ [list .mbar.merge entryconf [.mbar.merge index last] -state]
5360
+ .mbar.merge add command -label {Abort Merge...} \
5361
+ -command do_reset_hard \
5362
+ -font font_ui
5363
+ lappend disable_on_lock \
5364
+ [list .mbar.merge entryconf [.mbar.merge index last] -state]
5365
+
5366
+ }
5367
+
5368
+ # -- Transport Menu
5369
+ #
5370
+ if {[is_enabled transport]} {
5371
+ menu .mbar.fetch
5372
+
5373
+ menu .mbar.push
5374
+ .mbar.push add command -label {Push...} \
5375
+ -command do_push_anywhere \
5376
+ -font font_ui
5377
+ }
5378
+
5333
5379
if {[is_MacOSX]} {
5334
5380
# -- Apple Menu (Mac OS X only)
5335
5381
#
@@ -5502,28 +5548,6 @@ pack .branch.l1 -side left
5502
5548
pack .branch.cb -side left -fill x
5503
5549
pack .branch -side top -fill x
5504
5550
5505
- if {[is_enabled branch]} {
5506
- menu .mbar.merge
5507
- .mbar.merge add command -label {Local Merge...} \
5508
- -command do_local_merge \
5509
- -font font_ui
5510
- lappend disable_on_lock \
5511
- [list .mbar.merge entryconf [.mbar.merge index last] -state]
5512
- .mbar.merge add command -label {Abort Merge...} \
5513
- -command do_reset_hard \
5514
- -font font_ui
5515
- lappend disable_on_lock \
5516
- [list .mbar.merge entryconf [.mbar.merge index last] -state]
5517
-
5518
-
5519
- menu .mbar.fetch
5520
-
5521
- menu .mbar.push
5522
- .mbar.push add command -label {Push...} \
5523
- -command do_push_anywhere \
5524
- -font font_ui
5525
- }
5526
-
5527
5551
# -- Main Window Layout
5528
5552
#
5529
5553
panedwindow .vpane -orient vertical
0 commit comments