Skip to content

Commit 18725fd

Browse files
committed
Prevent drag and drop of tags and remote branches
Moving an annotated tag would convert it to a lightweight tag and lose the tags message. Given that tags are meant to represent a fixed point in the history and remote branches represent the state of the remote I'm disabling moving them.
1 parent b28afa1 commit 18725fd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

PBRefController.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ - (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexe
305305
return NO;
306306

307307
PBGitRef *ref = [[[cell objectValue] refs] objectAtIndex:index];
308+
if ([ref isTag] || [ref isRemoteBranch])
309+
return NO;
310+
308311
if ([[[historyController.repository headRef] ref] isEqualToRef:ref])
309312
return NO;
310313

0 commit comments

Comments
 (0)