field w_delete ; # delete button
constructor dialog {} {
- global all_heads current_branch
+ global current_branch
make_toplevel top w
wm title $top "[appname] ([reponame]): Delete Branch"
$w_check none {Always (Do not perform merge test.)}
pack $w.check -anchor nw -fill x -pady 5 -padx 5
- foreach h $all_heads {
+ foreach h [load_all_heads] {
if {$h ne $current_branch} {
$w_heads insert end $h
}
}
method _delete {} {
- global all_heads
-
if {[catch {set check_cmt [$w_check commit_or_die]}]} {
return
}
set o [lindex $i 1]
if {[catch {git update-ref -d "refs/heads/$b" $o} err]} {
append failed " - $b: $err\n"
- } else {
- set x [lsearch -sorted -exact $all_heads $b]
- if {$x >= 0} {
- set all_heads [lreplace $all_heads $x $x]
- }
}
}
-message "Failed to delete branches:\n$failed"
}
- set all_heads [lsort $all_heads]
- populate_branch_menu
destroy $w
}