Skip to content

Commit 986f49f

Browse files
committed
Don't allow drag-n-drop for the checked out branch.
Moving the checked out branch would cause odd things to happen to git's index.
1 parent c077f23 commit 986f49f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

PBRefController.m

+4
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ - (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexe
294294

295295
if (index == -1)
296296
return NO;
297+
298+
PBGitRef *ref = [[[cell objectValue] refs] objectAtIndex:index];
299+
if ([[[historyController.repository headRef] ref] isEqualToRef:ref])
300+
return NO;
297301

298302
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:[NSArray arrayWithObjects:[NSNumber numberWithInt:row], [NSNumber numberWithInt:index], NULL]];
299303
[pboard declareTypes:[NSArray arrayWithObject:@"PBGitRef"] owner:self];

0 commit comments

Comments
 (0)