Code

git-gui: Delete branches with 'git branch -D' to clear config
authorShawn O. Pearce <spearce@spearce.org>
Fri, 9 May 2008 00:29:42 +0000 (20:29 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 9 May 2008 00:29:42 +0000 (20:29 -0400)
If we are deleting a local branch from refs/heads/ we need to
make sure any associated configuration stored in .git/config is
also removed (such as branch.$name.remote and branch.$name.merge).
The easiest way to do this is to use git-branch as that automatically
will look for and delete configuration keys as necessary.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/branch_delete.tcl

index 86c4f73370a76ffa0196be0c58f11092b101cf0b..ef1930b4911591566be4561b8c17c24e1cfbfaad 100644 (file)
@@ -127,7 +127,7 @@ method _delete {} {
        foreach i $to_delete {
                set b [lindex $i 0]
                set o [lindex $i 1]
-               if {[catch {git update-ref -d "refs/heads/$b" $o} err]} {
+               if {[catch {git branch -D $b} err]} {
                        append failed " - $b: $err\n"
                }
        }