git-gui: Don't switch branches if changing to the current branch.
Its pointless to switch to the current branch, so don't do it. We are already on it and the current index and working directory should just be left alone. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 25, 2007 at 17:07 UTC
d070c4cb17e807c157aaeb24d9b80a1112334e57
1 file changed
+7
git-gui.sh
+7
@@ -2271,6 +2271,13 @@ The rescan will be automatically started now.
2271
return
2272
}
2273
2274
+ # -- Don't do a pointless switch.
2275
+ #
2276
+ if {$current_branch eq $new_branch} {
2277
+ unlock_index
2278
+ return
2279
+ }
2280
+
2281
if {$repo_config(gui.trustmtime) eq {true}} {
2282
switch_branch_stage2 {} $new_branch
2283
} else {