Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 41 lines (34 sloc) 1.042 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
//
// PBRefMenuItem.m
// GitX
//
// Created by Pieter de Bie on 01-11-08.
// Copyright 2008 Pieter de Bie. All rights reserved.
//

#import "PBRefMenuItem.h"


@implementation PBRefMenuItem
@synthesize ref, commit;

+ (NSArray *)defaultMenuItemsForRef:(PBGitRef *)ref commit:(PBGitCommit *)commit target:(id)target
{
NSMutableArray *array = [NSMutableArray array];
NSString *type = [ref type];
if ([type isEqualToString:@"remote"])
type = @"remote branch";
else if ([type isEqualToString:@"head"])
type = @"branch";

[array addObject:[[PBRefMenuItem alloc] initWithTitle:[@"Delete " stringByAppendingString:type]
action:@selector(removeRef:)
keyEquivalent: @""]];
if ([type isEqualToString:@"branch"])
[array addObject:[[PBRefMenuItem alloc] initWithTitle:@"Checkout branch"
action:@selector(checkoutRef:)
keyEquivalent: @""]];

for (PBRefMenuItem *item in array)
{
[item setTarget: target];
[item setRef: ref];
[item setCommit:commit];
}

return array;
}
@end
Something went wrong with that request. Please try again.