-
Notifications
You must be signed in to change notification settings - Fork 602
/
PBGitLane.h
51 lines (40 loc) · 708 Bytes
/
PBGitLane.h
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
42
43
44
45
46
47
48
49
50
51
//
// PBGitLane.h
// GitX
//
// Created by Pieter de Bie on 27-08-08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#include "git/oid.h"
class PBGitLane {
static int s_colorIndex;
git_oid d_sha;
int d_index;
public:
PBGitLane(git_oid *sha)
{
d_index = s_colorIndex++;
d_sha = *sha;
}
PBGitLane(NSString *sha)
{
git_oid_mkstr(&d_sha, [sha UTF8String]);
d_index = s_colorIndex++;
}
PBGitLane()
{
d_index = s_colorIndex++;
}
bool isCommit(git_oid *sha) const
{
return !git_oid_cmp(&d_sha, sha);
}
void setSha(git_oid sha);
git_oid const *sha() const
{
return &d_sha;
}
int index() const;
static void resetColors();
};