line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
/* |
2
|
|
|
|
|
|
|
* Copyright (C) the libgit2 contributors. All rights reserved. |
3
|
|
|
|
|
|
|
* |
4
|
|
|
|
|
|
|
* This file is part of libgit2, distributed under the GNU GPL v2 with |
5
|
|
|
|
|
|
|
* a Linking Exception. For full terms see the included COPYING file. |
6
|
|
|
|
|
|
|
*/ |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#include "common.h" |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#include "git2/object.h" |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#include "repository.h" |
13
|
|
|
|
|
|
|
#include "commit.h" |
14
|
|
|
|
|
|
|
#include "tree.h" |
15
|
|
|
|
|
|
|
#include "blob.h" |
16
|
|
|
|
|
|
|
#include "tag.h" |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
/** |
19
|
|
|
|
|
|
|
* Commit |
20
|
|
|
|
|
|
|
*/ |
21
|
285
|
|
|
|
|
|
int git_commit_lookup(git_commit **out, git_repository *repo, const git_oid *id) |
22
|
|
|
|
|
|
|
{ |
23
|
285
|
|
|
|
|
|
return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_COMMIT); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
4
|
|
|
|
|
|
int git_commit_lookup_prefix(git_commit **out, git_repository *repo, const git_oid *id, size_t len) |
27
|
|
|
|
|
|
|
{ |
28
|
4
|
|
|
|
|
|
return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_COMMIT); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
462
|
|
|
|
|
|
void git_commit_free(git_commit *obj) |
32
|
|
|
|
|
|
|
{ |
33
|
462
|
|
|
|
|
|
git_object_free((git_object *)obj); |
34
|
462
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
479
|
|
|
|
|
|
const git_oid *git_commit_id(const git_commit *obj) |
37
|
|
|
|
|
|
|
{ |
38
|
479
|
|
|
|
|
|
return git_object_id((const git_object *)obj); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
57
|
|
|
|
|
|
git_repository *git_commit_owner(const git_commit *obj) |
42
|
|
|
|
|
|
|
{ |
43
|
57
|
|
|
|
|
|
return git_object_owner((const git_object *)obj); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
58
|
|
|
|
|
|
int git_commit_dup(git_commit **out, git_commit *obj) |
47
|
|
|
|
|
|
|
{ |
48
|
58
|
|
|
|
|
|
return git_object_dup((git_object **)out, (git_object *)obj); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
/** |
52
|
|
|
|
|
|
|
* Tree |
53
|
|
|
|
|
|
|
*/ |
54
|
815
|
|
|
|
|
|
int git_tree_lookup(git_tree **out, git_repository *repo, const git_oid *id) |
55
|
|
|
|
|
|
|
{ |
56
|
815
|
|
|
|
|
|
return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_TREE); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
3
|
|
|
|
|
|
int git_tree_lookup_prefix(git_tree **out, git_repository *repo, const git_oid *id, size_t len) |
60
|
|
|
|
|
|
|
{ |
61
|
3
|
|
|
|
|
|
return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_TREE); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
4119
|
|
|
|
|
|
void git_tree_free(git_tree *obj) |
65
|
|
|
|
|
|
|
{ |
66
|
4119
|
|
|
|
|
|
git_object_free((git_object *)obj); |
67
|
4119
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
256
|
|
|
|
|
|
const git_oid *git_tree_id(const git_tree *obj) |
70
|
|
|
|
|
|
|
{ |
71
|
256
|
|
|
|
|
|
return git_object_id((const git_object *)obj); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
486
|
|
|
|
|
|
git_repository *git_tree_owner(const git_tree *obj) |
75
|
|
|
|
|
|
|
{ |
76
|
486
|
|
|
|
|
|
return git_object_owner((const git_object *)obj); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
870
|
|
|
|
|
|
int git_tree_dup(git_tree **out, git_tree *obj) |
80
|
|
|
|
|
|
|
{ |
81
|
870
|
|
|
|
|
|
return git_object_dup((git_object **)out, (git_object *)obj); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
/** |
85
|
|
|
|
|
|
|
* Tag |
86
|
|
|
|
|
|
|
*/ |
87
|
1
|
|
|
|
|
|
int git_tag_lookup(git_tag **out, git_repository *repo, const git_oid *id) |
88
|
|
|
|
|
|
|
{ |
89
|
1
|
|
|
|
|
|
return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_TAG); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
2
|
|
|
|
|
|
int git_tag_lookup_prefix(git_tag **out, git_repository *repo, const git_oid *id, size_t len) |
93
|
|
|
|
|
|
|
{ |
94
|
2
|
|
|
|
|
|
return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_TAG); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
8
|
|
|
|
|
|
void git_tag_free(git_tag *obj) |
98
|
|
|
|
|
|
|
{ |
99
|
8
|
|
|
|
|
|
git_object_free((git_object *)obj); |
100
|
8
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
4
|
|
|
|
|
|
const git_oid *git_tag_id(const git_tag *obj) |
103
|
|
|
|
|
|
|
{ |
104
|
4
|
|
|
|
|
|
return git_object_id((const git_object *)obj); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
|
|
|
git_repository *git_tag_owner(const git_tag *obj) |
108
|
|
|
|
|
|
|
{ |
109
|
0
|
|
|
|
|
|
return git_object_owner((const git_object *)obj); |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
0
|
|
|
|
|
|
int git_tag_dup(git_tag **out, git_tag *obj) |
113
|
|
|
|
|
|
|
{ |
114
|
0
|
|
|
|
|
|
return git_object_dup((git_object **)out, (git_object *)obj); |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
/** |
118
|
|
|
|
|
|
|
* Blob |
119
|
|
|
|
|
|
|
*/ |
120
|
144
|
|
|
|
|
|
int git_blob_lookup(git_blob **out, git_repository *repo, const git_oid *id) |
121
|
|
|
|
|
|
|
{ |
122
|
144
|
|
|
|
|
|
return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_BLOB); |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
3
|
|
|
|
|
|
int git_blob_lookup_prefix(git_blob **out, git_repository *repo, const git_oid *id, size_t len) |
126
|
|
|
|
|
|
|
{ |
127
|
3
|
|
|
|
|
|
return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_BLOB); |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
2340
|
|
|
|
|
|
void git_blob_free(git_blob *obj) |
131
|
|
|
|
|
|
|
{ |
132
|
2340
|
|
|
|
|
|
git_object_free((git_object *)obj); |
133
|
2340
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
96
|
|
|
|
|
|
const git_oid *git_blob_id(const git_blob *obj) |
136
|
|
|
|
|
|
|
{ |
137
|
96
|
|
|
|
|
|
return git_object_id((const git_object *)obj); |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
1
|
|
|
|
|
|
git_repository *git_blob_owner(const git_blob *obj) |
141
|
|
|
|
|
|
|
{ |
142
|
1
|
|
|
|
|
|
return git_object_owner((const git_object *)obj); |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
1
|
|
|
|
|
|
int git_blob_dup(git_blob **out, git_blob *obj) |
146
|
|
|
|
|
|
|
{ |
147
|
1
|
|
|
|
|
|
return git_object_dup((git_object **)out, (git_object *)obj); |
148
|
|
|
|
|
|
|
} |