Line | Count | Source |
1 | | #ifndef ODB_SOURCE_H |
2 | | #define ODB_SOURCE_H |
3 | | |
4 | | #include "object.h" |
5 | | |
6 | | enum odb_source_type { |
7 | | /* |
8 | | * The "unknown" type, which should never be in use. This type mostly |
9 | | * exists to catch cases where the type field remains zeroed out. |
10 | | */ |
11 | | ODB_SOURCE_UNKNOWN, |
12 | | |
13 | | /* The "files" backend that uses loose objects and packfiles. */ |
14 | | ODB_SOURCE_FILES, |
15 | | }; |
16 | | |
17 | | /* Flags that can be passed to `odb_read_object_info_extended()`. */ |
18 | | enum object_info_flags { |
19 | | /* Invoke lookup_replace_object() on the given hash. */ |
20 | | OBJECT_INFO_LOOKUP_REPLACE = (1 << 0), |
21 | | |
22 | | /* Do not reprepare object sources when the first lookup has failed. */ |
23 | | OBJECT_INFO_QUICK = (1 << 1), |
24 | | |
25 | | /* |
26 | | * Do not attempt to fetch the object if missing (even if fetch_is_missing is |
27 | | * nonzero). |
28 | | */ |
29 | | OBJECT_INFO_SKIP_FETCH_OBJECT = (1 << 2), |
30 | | |
31 | | /* Die if object corruption (not just an object being missing) was detected. */ |
32 | | OBJECT_INFO_DIE_IF_CORRUPT = (1 << 3), |
33 | | |
34 | | /* |
35 | | * We have already tried reading the object, but it couldn't be found |
36 | | * via any of the attached sources, and are now doing a second read. |
37 | | * This second read asks the individual sources to also evaluate |
38 | | * whether any on-disk state may have changed that may have caused the |
39 | | * object to appear. |
40 | | * |
41 | | * This flag is for internal use, only. The second read only occurs |
42 | | * when `OBJECT_INFO_QUICK` was not passed. |
43 | | */ |
44 | | OBJECT_INFO_SECOND_READ = (1 << 4), |
45 | | |
46 | | /* |
47 | | * This is meant for bulk prefetching of missing blobs in a partial |
48 | | * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK. |
49 | | */ |
50 | | OBJECT_INFO_FOR_PREFETCH = (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK), |
51 | | }; |
52 | | |
53 | | struct object_id; |
54 | | struct object_info; |
55 | | struct odb_read_stream; |
56 | | struct odb_transaction; |
57 | | struct odb_write_stream; |
58 | | struct strvec; |
59 | | |
60 | | /* |
61 | | * A callback function that can be used to iterate through objects. If given, |
62 | | * the optional `oi` parameter will be populated the same as if you would call |
63 | | * `odb_read_object_info()`. |
64 | | * |
65 | | * Returning a non-zero error code will cause iteration to abort. The error |
66 | | * code will be propagated. |
67 | | */ |
68 | | typedef int (*odb_for_each_object_cb)(const struct object_id *oid, |
69 | | struct object_info *oi, |
70 | | void *cb_data); |
71 | | |
72 | | /* |
73 | | * The source is the part of the object database that stores the actual |
74 | | * objects. It thus encapsulates the logic to read and write the specific |
75 | | * on-disk format. An object database can have multiple sources: |
76 | | * |
77 | | * - The primary source, which is typically located in "$GIT_DIR/objects". |
78 | | * This is where new objects are usually written to. |
79 | | * |
80 | | * - Alternate sources, which are configured via "objects/info/alternates" or |
81 | | * via the GIT_ALTERNATE_OBJECT_DIRECTORIES environment variable. These |
82 | | * alternate sources are only used to read objects. |
83 | | */ |
84 | | struct odb_source { |
85 | | struct odb_source *next; |
86 | | |
87 | | /* Object database that owns this object source. */ |
88 | | struct object_database *odb; |
89 | | |
90 | | /* The type used by this source. */ |
91 | | enum odb_source_type type; |
92 | | |
93 | | /* |
94 | | * Figure out whether this is the local source of the owning |
95 | | * repository, which would typically be its ".git/objects" directory. |
96 | | * This local object directory is usually where objects would be |
97 | | * written to. |
98 | | */ |
99 | | bool local; |
100 | | |
101 | | /* |
102 | | * This object store is ephemeral, so there is no need to fsync. |
103 | | */ |
104 | | int will_destroy; |
105 | | |
106 | | /* |
107 | | * Path to the source. If this is a relative path, it is relative to |
108 | | * the current working directory. |
109 | | */ |
110 | | char *path; |
111 | | |
112 | | /* |
113 | | * This callback is expected to free the underlying object database source and |
114 | | * all associated resources. The function will never be called with a NULL pointer. |
115 | | */ |
116 | | void (*free)(struct odb_source *source); |
117 | | |
118 | | /* |
119 | | * This callback is expected to close any open resources, like for |
120 | | * example file descriptors or connections. The source is expected to |
121 | | * still be usable after it has been closed. Closed resources may need |
122 | | * to be reopened in that case. |
123 | | */ |
124 | | void (*close)(struct odb_source *source); |
125 | | |
126 | | /* |
127 | | * This callback is expected to clear underlying caches of the object |
128 | | * database source. The function is called when the repository has for |
129 | | * example just been repacked so that new objects will become visible. |
130 | | */ |
131 | | void (*reprepare)(struct odb_source *source); |
132 | | |
133 | | /* |
134 | | * This callback is expected to read object information from the object |
135 | | * database source. The object info will be partially populated with |
136 | | * pointers for each bit of information that was requested by the |
137 | | * caller. |
138 | | * |
139 | | * The flags field is a combination of `OBJECT_INFO` flags. Only the |
140 | | * following fields need to be handled by the backend: |
141 | | * |
142 | | * - `OBJECT_INFO_QUICK` indicates it is fine to use caches without |
143 | | * re-verifying the data. |
144 | | * |
145 | | * - `OBJECT_INFO_SECOND_READ` indicates that the initial object |
146 | | * lookup has failed and that the object sources should check |
147 | | * whether any of its on-disk state has changed that may have |
148 | | * caused the object to appear. Sources are free to ignore the |
149 | | * second read in case they know that the first read would have |
150 | | * already surfaced the object without reloading any on-disk state. |
151 | | * |
152 | | * The callback is expected to return a negative error code in case |
153 | | * reading the object has failed, 0 otherwise. |
154 | | */ |
155 | | int (*read_object_info)(struct odb_source *source, |
156 | | const struct object_id *oid, |
157 | | struct object_info *oi, |
158 | | enum object_info_flags flags); |
159 | | |
160 | | /* |
161 | | * This callback is expected to create a new read stream that can be |
162 | | * used to stream the object identified by the given ID. |
163 | | * |
164 | | * The callback is expected to return a negative error code in case |
165 | | * creating the object stream has failed, 0 otherwise. |
166 | | */ |
167 | | int (*read_object_stream)(struct odb_read_stream **out, |
168 | | struct odb_source *source, |
169 | | const struct object_id *oid); |
170 | | |
171 | | /* |
172 | | * This callback is expected to iterate over all objects stored in this |
173 | | * source and invoke the callback function for each of them. It is |
174 | | * valid to yield the same object multiple time. A non-zero exit code |
175 | | * from the object callback shall abort iteration. |
176 | | * |
177 | | * The optional `request` structure should serve as a template for |
178 | | * looking up object info for every individual iterated object. It |
179 | | * should not be modified directly and should instead be copied into a |
180 | | * separate `struct object_info` that gets passed to the callback. If |
181 | | * the caller passes a `NULL` pointer then the object itself shall not |
182 | | * be read. |
183 | | * |
184 | | * The callback is expected to return a negative error code in case the |
185 | | * iteration has failed to read all objects, 0 otherwise. When the |
186 | | * callback function returns a non-zero error code then that error code |
187 | | * should be returned. |
188 | | */ |
189 | | int (*for_each_object)(struct odb_source *source, |
190 | | const struct object_info *request, |
191 | | odb_for_each_object_cb cb, |
192 | | void *cb_data, |
193 | | unsigned flags); |
194 | | |
195 | | /* |
196 | | * This callback is expected to freshen the given object so that its |
197 | | * last access time is set to the current time. This is used to ensure |
198 | | * that objects that are recent will not get garbage collected even if |
199 | | * they were unreachable. |
200 | | * |
201 | | * Returns 0 in case the object does not exist, 1 in case the object |
202 | | * has been freshened. |
203 | | */ |
204 | | int (*freshen_object)(struct odb_source *source, |
205 | | const struct object_id *oid); |
206 | | |
207 | | /* |
208 | | * This callback is expected to persist the given object into the |
209 | | * object source. In case the object already exists it shall be |
210 | | * freshened. |
211 | | * |
212 | | * The flags field is a combination of `WRITE_OBJECT` flags. |
213 | | * |
214 | | * The resulting object ID (and optionally the compatibility object ID) |
215 | | * shall be written into the out pointers. The callback is expected to |
216 | | * return 0 on success, a negative error code otherwise. |
217 | | */ |
218 | | int (*write_object)(struct odb_source *source, |
219 | | const void *buf, unsigned long len, |
220 | | enum object_type type, |
221 | | struct object_id *oid, |
222 | | struct object_id *compat_oid, |
223 | | unsigned flags); |
224 | | |
225 | | /* |
226 | | * This callback is expected to persist the given object stream into |
227 | | * the object source. |
228 | | * |
229 | | * The resulting object ID shall be written into the out pointer. The |
230 | | * callback is expected to return 0 on success, a negative error code |
231 | | * otherwise. |
232 | | */ |
233 | | int (*write_object_stream)(struct odb_source *source, |
234 | | struct odb_write_stream *stream, size_t len, |
235 | | struct object_id *oid); |
236 | | |
237 | | /* |
238 | | * This callback is expected to create a new transaction that can be |
239 | | * used to write objects to. The objects shall only be persisted into |
240 | | * the object database when the transcation's commit function is |
241 | | * called. Otherwise, the objects shall be discarded. |
242 | | * |
243 | | * Returns 0 on success, in which case the `*out` pointer will have |
244 | | * been populated with the object database transaction. Returns a |
245 | | * negative error code otherwise. |
246 | | */ |
247 | | int (*begin_transaction)(struct odb_source *source, |
248 | | struct odb_transaction **out); |
249 | | |
250 | | /* |
251 | | * This callback is expected to read the list of alternate object |
252 | | * database sources connected to it and write them into the `strvec`. |
253 | | * |
254 | | * The result is expected to be paths to the alternates. All paths must |
255 | | * be resolved to absolute paths. |
256 | | * |
257 | | * The callback is expected to return 0 on success, a negative error |
258 | | * code otherwise. |
259 | | */ |
260 | | int (*read_alternates)(struct odb_source *source, |
261 | | struct strvec *out); |
262 | | |
263 | | /* |
264 | | * This callback is expected to persist the singular alternate passed |
265 | | * to it into its list of alternates. Any pre-existing alternates are |
266 | | * expected to remain active. Subsequent calls to `read_alternates` are |
267 | | * thus expected to yield the pre-existing list of alternates plus the |
268 | | * newly added alternate appended to its end. |
269 | | * |
270 | | * The callback is expected to return 0 on success, a negative error |
271 | | * code otherwise. |
272 | | */ |
273 | | int (*write_alternate)(struct odb_source *source, |
274 | | const char *alternate); |
275 | | }; |
276 | | |
277 | | /* |
278 | | * Allocate and initialize a new source for the given object database located |
279 | | * at `path`. `local` indicates whether or not the source is the local and thus |
280 | | * primary object source of the object database. |
281 | | */ |
282 | | struct odb_source *odb_source_new(struct object_database *odb, |
283 | | const char *path, |
284 | | bool local); |
285 | | |
286 | | /* |
287 | | * Initialize the source for the given object database located at `path`. |
288 | | * `local` indicates whether or not the source is the local and thus primary |
289 | | * object source of the object database. |
290 | | * |
291 | | * This function is only supposed to be called by specific object source |
292 | | * implementations. |
293 | | */ |
294 | | void odb_source_init(struct odb_source *source, |
295 | | struct object_database *odb, |
296 | | enum odb_source_type type, |
297 | | const char *path, |
298 | | bool local); |
299 | | |
300 | | /* |
301 | | * Free the object database source, releasing all associated resources and |
302 | | * freeing the structure itself. |
303 | | */ |
304 | | void odb_source_free(struct odb_source *source); |
305 | | |
306 | | /* |
307 | | * Release the object database source, releasing all associated resources. |
308 | | * |
309 | | * This function is only supposed to be called by specific object source |
310 | | * implementations. |
311 | | */ |
312 | | void odb_source_release(struct odb_source *source); |
313 | | |
314 | | /* |
315 | | * Close the object database source without releasing he underlying data. The |
316 | | * source can still be used going forward, but it first needs to be reopened. |
317 | | * This can be useful to reduce resource usage. |
318 | | */ |
319 | | static inline void odb_source_close(struct odb_source *source) |
320 | 0 | { |
321 | 0 | source->close(source); |
322 | 0 | } Unexecuted instantiation: run-command.c:odb_source_close Unexecuted instantiation: config.c:odb_source_close Unexecuted instantiation: dir.c:odb_source_close Unexecuted instantiation: mailmap.c:odb_source_close Unexecuted instantiation: object-file.c:odb_source_close Unexecuted instantiation: object-name.c:odb_source_close Unexecuted instantiation: object.c:odb_source_close Unexecuted instantiation: odb.c:odb_source_close Unexecuted instantiation: source.c:odb_source_close Unexecuted instantiation: source-files.c:odb_source_close Unexecuted instantiation: streaming.c:odb_source_close Unexecuted instantiation: pack-write.c:odb_source_close Unexecuted instantiation: packfile.c:odb_source_close Unexecuted instantiation: path.c:odb_source_close Unexecuted instantiation: promisor-remote.c:odb_source_close Unexecuted instantiation: read-cache.c:odb_source_close Unexecuted instantiation: refs.c:odb_source_close Unexecuted instantiation: remote.c:odb_source_close Unexecuted instantiation: replace-object.c:odb_source_close Unexecuted instantiation: repo-settings.c:odb_source_close Unexecuted instantiation: repository.c:odb_source_close Unexecuted instantiation: revision.c:odb_source_close Unexecuted instantiation: setup.c:odb_source_close Unexecuted instantiation: shallow.c:odb_source_close Unexecuted instantiation: submodule-config.c:odb_source_close Unexecuted instantiation: submodule.c:odb_source_close Unexecuted instantiation: tag.c:odb_source_close Unexecuted instantiation: tmp-objdir.c:odb_source_close Unexecuted instantiation: tree-walk.c:odb_source_close Unexecuted instantiation: tree.c:odb_source_close Unexecuted instantiation: attr.c:odb_source_close Unexecuted instantiation: bisect.c:odb_source_close Unexecuted instantiation: bloom.c:odb_source_close Unexecuted instantiation: bundle-uri.c:odb_source_close Unexecuted instantiation: bundle.c:odb_source_close Unexecuted instantiation: cache-tree.c:odb_source_close Unexecuted instantiation: combine-diff.c:odb_source_close Unexecuted instantiation: commit-graph.c:odb_source_close Unexecuted instantiation: commit-reach.c:odb_source_close Unexecuted instantiation: commit.c:odb_source_close Unexecuted instantiation: connected.c:odb_source_close Unexecuted instantiation: convert.c:odb_source_close Unexecuted instantiation: diff.c:odb_source_close Unexecuted instantiation: diffcore-rename.c:odb_source_close Unexecuted instantiation: fetch-pack.c:odb_source_close Unexecuted instantiation: fsck.c:odb_source_close Unexecuted instantiation: grep.c:odb_source_close Unexecuted instantiation: list-objects.c:odb_source_close Unexecuted instantiation: log-tree.c:odb_source_close Unexecuted instantiation: loose.c:odb_source_close Unexecuted instantiation: merge-ort.c:odb_source_close Unexecuted instantiation: midx.c:odb_source_close Unexecuted instantiation: notes-cache.c:odb_source_close Unexecuted instantiation: notes.c:odb_source_close Unexecuted instantiation: pack-check.c:odb_source_close Unexecuted instantiation: pack-mtimes.c:odb_source_close Unexecuted instantiation: pack-revindex.c:odb_source_close Unexecuted instantiation: send-pack.c:odb_source_close Unexecuted instantiation: sequencer.c:odb_source_close Unexecuted instantiation: transport-helper.c:odb_source_close Unexecuted instantiation: unpack-trees.c:odb_source_close Unexecuted instantiation: xdiff-interface.c:odb_source_close Unexecuted instantiation: apply.c:odb_source_close Unexecuted instantiation: entry.c:odb_source_close Unexecuted instantiation: list-objects-filter.c:odb_source_close Unexecuted instantiation: match-trees.c:odb_source_close Unexecuted instantiation: rerere.c:odb_source_close |
323 | | |
324 | | /* |
325 | | * Reprepare the object database source and clear any caches. Depending on the |
326 | | * backend used this may have the effect that concurrently-written objects |
327 | | * become visible. |
328 | | */ |
329 | | static inline void odb_source_reprepare(struct odb_source *source) |
330 | 0 | { |
331 | 0 | source->reprepare(source); |
332 | 0 | } Unexecuted instantiation: run-command.c:odb_source_reprepare Unexecuted instantiation: config.c:odb_source_reprepare Unexecuted instantiation: dir.c:odb_source_reprepare Unexecuted instantiation: mailmap.c:odb_source_reprepare Unexecuted instantiation: object-file.c:odb_source_reprepare Unexecuted instantiation: object-name.c:odb_source_reprepare Unexecuted instantiation: object.c:odb_source_reprepare Unexecuted instantiation: odb.c:odb_source_reprepare Unexecuted instantiation: source.c:odb_source_reprepare Unexecuted instantiation: source-files.c:odb_source_reprepare Unexecuted instantiation: streaming.c:odb_source_reprepare Unexecuted instantiation: pack-write.c:odb_source_reprepare Unexecuted instantiation: packfile.c:odb_source_reprepare Unexecuted instantiation: path.c:odb_source_reprepare Unexecuted instantiation: promisor-remote.c:odb_source_reprepare Unexecuted instantiation: read-cache.c:odb_source_reprepare Unexecuted instantiation: refs.c:odb_source_reprepare Unexecuted instantiation: remote.c:odb_source_reprepare Unexecuted instantiation: replace-object.c:odb_source_reprepare Unexecuted instantiation: repo-settings.c:odb_source_reprepare Unexecuted instantiation: repository.c:odb_source_reprepare Unexecuted instantiation: revision.c:odb_source_reprepare Unexecuted instantiation: setup.c:odb_source_reprepare Unexecuted instantiation: shallow.c:odb_source_reprepare Unexecuted instantiation: submodule-config.c:odb_source_reprepare Unexecuted instantiation: submodule.c:odb_source_reprepare Unexecuted instantiation: tag.c:odb_source_reprepare Unexecuted instantiation: tmp-objdir.c:odb_source_reprepare Unexecuted instantiation: tree-walk.c:odb_source_reprepare Unexecuted instantiation: tree.c:odb_source_reprepare Unexecuted instantiation: attr.c:odb_source_reprepare Unexecuted instantiation: bisect.c:odb_source_reprepare Unexecuted instantiation: bloom.c:odb_source_reprepare Unexecuted instantiation: bundle-uri.c:odb_source_reprepare Unexecuted instantiation: bundle.c:odb_source_reprepare Unexecuted instantiation: cache-tree.c:odb_source_reprepare Unexecuted instantiation: combine-diff.c:odb_source_reprepare Unexecuted instantiation: commit-graph.c:odb_source_reprepare Unexecuted instantiation: commit-reach.c:odb_source_reprepare Unexecuted instantiation: commit.c:odb_source_reprepare Unexecuted instantiation: connected.c:odb_source_reprepare Unexecuted instantiation: convert.c:odb_source_reprepare Unexecuted instantiation: diff.c:odb_source_reprepare Unexecuted instantiation: diffcore-rename.c:odb_source_reprepare Unexecuted instantiation: fetch-pack.c:odb_source_reprepare Unexecuted instantiation: fsck.c:odb_source_reprepare Unexecuted instantiation: grep.c:odb_source_reprepare Unexecuted instantiation: list-objects.c:odb_source_reprepare Unexecuted instantiation: log-tree.c:odb_source_reprepare Unexecuted instantiation: loose.c:odb_source_reprepare Unexecuted instantiation: merge-ort.c:odb_source_reprepare Unexecuted instantiation: midx.c:odb_source_reprepare Unexecuted instantiation: notes-cache.c:odb_source_reprepare Unexecuted instantiation: notes.c:odb_source_reprepare Unexecuted instantiation: pack-check.c:odb_source_reprepare Unexecuted instantiation: pack-mtimes.c:odb_source_reprepare Unexecuted instantiation: pack-revindex.c:odb_source_reprepare Unexecuted instantiation: send-pack.c:odb_source_reprepare Unexecuted instantiation: sequencer.c:odb_source_reprepare Unexecuted instantiation: transport-helper.c:odb_source_reprepare Unexecuted instantiation: unpack-trees.c:odb_source_reprepare Unexecuted instantiation: xdiff-interface.c:odb_source_reprepare Unexecuted instantiation: apply.c:odb_source_reprepare Unexecuted instantiation: entry.c:odb_source_reprepare Unexecuted instantiation: list-objects-filter.c:odb_source_reprepare Unexecuted instantiation: match-trees.c:odb_source_reprepare Unexecuted instantiation: rerere.c:odb_source_reprepare |
333 | | |
334 | | /* |
335 | | * Read an object from the object database source identified by its object ID. |
336 | | * Returns 0 on success, a negative error code otherwise. |
337 | | */ |
338 | | static inline int odb_source_read_object_info(struct odb_source *source, |
339 | | const struct object_id *oid, |
340 | | struct object_info *oi, |
341 | | enum object_info_flags flags) |
342 | 0 | { |
343 | 0 | return source->read_object_info(source, oid, oi, flags); |
344 | 0 | } Unexecuted instantiation: run-command.c:odb_source_read_object_info Unexecuted instantiation: config.c:odb_source_read_object_info Unexecuted instantiation: dir.c:odb_source_read_object_info Unexecuted instantiation: mailmap.c:odb_source_read_object_info Unexecuted instantiation: object-file.c:odb_source_read_object_info Unexecuted instantiation: object-name.c:odb_source_read_object_info Unexecuted instantiation: object.c:odb_source_read_object_info Unexecuted instantiation: odb.c:odb_source_read_object_info Unexecuted instantiation: source.c:odb_source_read_object_info Unexecuted instantiation: source-files.c:odb_source_read_object_info Unexecuted instantiation: streaming.c:odb_source_read_object_info Unexecuted instantiation: pack-write.c:odb_source_read_object_info Unexecuted instantiation: packfile.c:odb_source_read_object_info Unexecuted instantiation: path.c:odb_source_read_object_info Unexecuted instantiation: promisor-remote.c:odb_source_read_object_info Unexecuted instantiation: read-cache.c:odb_source_read_object_info Unexecuted instantiation: refs.c:odb_source_read_object_info Unexecuted instantiation: remote.c:odb_source_read_object_info Unexecuted instantiation: replace-object.c:odb_source_read_object_info Unexecuted instantiation: repo-settings.c:odb_source_read_object_info Unexecuted instantiation: repository.c:odb_source_read_object_info Unexecuted instantiation: revision.c:odb_source_read_object_info Unexecuted instantiation: setup.c:odb_source_read_object_info Unexecuted instantiation: shallow.c:odb_source_read_object_info Unexecuted instantiation: submodule-config.c:odb_source_read_object_info Unexecuted instantiation: submodule.c:odb_source_read_object_info Unexecuted instantiation: tag.c:odb_source_read_object_info Unexecuted instantiation: tmp-objdir.c:odb_source_read_object_info Unexecuted instantiation: tree-walk.c:odb_source_read_object_info Unexecuted instantiation: tree.c:odb_source_read_object_info Unexecuted instantiation: attr.c:odb_source_read_object_info Unexecuted instantiation: bisect.c:odb_source_read_object_info Unexecuted instantiation: bloom.c:odb_source_read_object_info Unexecuted instantiation: bundle-uri.c:odb_source_read_object_info Unexecuted instantiation: bundle.c:odb_source_read_object_info Unexecuted instantiation: cache-tree.c:odb_source_read_object_info Unexecuted instantiation: combine-diff.c:odb_source_read_object_info Unexecuted instantiation: commit-graph.c:odb_source_read_object_info Unexecuted instantiation: commit-reach.c:odb_source_read_object_info Unexecuted instantiation: commit.c:odb_source_read_object_info Unexecuted instantiation: connected.c:odb_source_read_object_info Unexecuted instantiation: convert.c:odb_source_read_object_info Unexecuted instantiation: diff.c:odb_source_read_object_info Unexecuted instantiation: diffcore-rename.c:odb_source_read_object_info Unexecuted instantiation: fetch-pack.c:odb_source_read_object_info Unexecuted instantiation: fsck.c:odb_source_read_object_info Unexecuted instantiation: grep.c:odb_source_read_object_info Unexecuted instantiation: list-objects.c:odb_source_read_object_info Unexecuted instantiation: log-tree.c:odb_source_read_object_info Unexecuted instantiation: loose.c:odb_source_read_object_info Unexecuted instantiation: merge-ort.c:odb_source_read_object_info Unexecuted instantiation: midx.c:odb_source_read_object_info Unexecuted instantiation: notes-cache.c:odb_source_read_object_info Unexecuted instantiation: notes.c:odb_source_read_object_info Unexecuted instantiation: pack-check.c:odb_source_read_object_info Unexecuted instantiation: pack-mtimes.c:odb_source_read_object_info Unexecuted instantiation: pack-revindex.c:odb_source_read_object_info Unexecuted instantiation: send-pack.c:odb_source_read_object_info Unexecuted instantiation: sequencer.c:odb_source_read_object_info Unexecuted instantiation: transport-helper.c:odb_source_read_object_info Unexecuted instantiation: unpack-trees.c:odb_source_read_object_info Unexecuted instantiation: xdiff-interface.c:odb_source_read_object_info Unexecuted instantiation: apply.c:odb_source_read_object_info Unexecuted instantiation: entry.c:odb_source_read_object_info Unexecuted instantiation: list-objects-filter.c:odb_source_read_object_info Unexecuted instantiation: match-trees.c:odb_source_read_object_info Unexecuted instantiation: rerere.c:odb_source_read_object_info |
345 | | |
346 | | /* |
347 | | * Create a new read stream for the given object ID. Returns 0 on success, a |
348 | | * negative error code otherwise. |
349 | | */ |
350 | | static inline int odb_source_read_object_stream(struct odb_read_stream **out, |
351 | | struct odb_source *source, |
352 | | const struct object_id *oid) |
353 | 0 | { |
354 | 0 | return source->read_object_stream(out, source, oid); |
355 | 0 | } Unexecuted instantiation: run-command.c:odb_source_read_object_stream Unexecuted instantiation: config.c:odb_source_read_object_stream Unexecuted instantiation: dir.c:odb_source_read_object_stream Unexecuted instantiation: mailmap.c:odb_source_read_object_stream Unexecuted instantiation: object-file.c:odb_source_read_object_stream Unexecuted instantiation: object-name.c:odb_source_read_object_stream Unexecuted instantiation: object.c:odb_source_read_object_stream Unexecuted instantiation: odb.c:odb_source_read_object_stream Unexecuted instantiation: source.c:odb_source_read_object_stream Unexecuted instantiation: source-files.c:odb_source_read_object_stream Unexecuted instantiation: streaming.c:odb_source_read_object_stream Unexecuted instantiation: pack-write.c:odb_source_read_object_stream Unexecuted instantiation: packfile.c:odb_source_read_object_stream Unexecuted instantiation: path.c:odb_source_read_object_stream Unexecuted instantiation: promisor-remote.c:odb_source_read_object_stream Unexecuted instantiation: read-cache.c:odb_source_read_object_stream Unexecuted instantiation: refs.c:odb_source_read_object_stream Unexecuted instantiation: remote.c:odb_source_read_object_stream Unexecuted instantiation: replace-object.c:odb_source_read_object_stream Unexecuted instantiation: repo-settings.c:odb_source_read_object_stream Unexecuted instantiation: repository.c:odb_source_read_object_stream Unexecuted instantiation: revision.c:odb_source_read_object_stream Unexecuted instantiation: setup.c:odb_source_read_object_stream Unexecuted instantiation: shallow.c:odb_source_read_object_stream Unexecuted instantiation: submodule-config.c:odb_source_read_object_stream Unexecuted instantiation: submodule.c:odb_source_read_object_stream Unexecuted instantiation: tag.c:odb_source_read_object_stream Unexecuted instantiation: tmp-objdir.c:odb_source_read_object_stream Unexecuted instantiation: tree-walk.c:odb_source_read_object_stream Unexecuted instantiation: tree.c:odb_source_read_object_stream Unexecuted instantiation: attr.c:odb_source_read_object_stream Unexecuted instantiation: bisect.c:odb_source_read_object_stream Unexecuted instantiation: bloom.c:odb_source_read_object_stream Unexecuted instantiation: bundle-uri.c:odb_source_read_object_stream Unexecuted instantiation: bundle.c:odb_source_read_object_stream Unexecuted instantiation: cache-tree.c:odb_source_read_object_stream Unexecuted instantiation: combine-diff.c:odb_source_read_object_stream Unexecuted instantiation: commit-graph.c:odb_source_read_object_stream Unexecuted instantiation: commit-reach.c:odb_source_read_object_stream Unexecuted instantiation: commit.c:odb_source_read_object_stream Unexecuted instantiation: connected.c:odb_source_read_object_stream Unexecuted instantiation: convert.c:odb_source_read_object_stream Unexecuted instantiation: diff.c:odb_source_read_object_stream Unexecuted instantiation: diffcore-rename.c:odb_source_read_object_stream Unexecuted instantiation: fetch-pack.c:odb_source_read_object_stream Unexecuted instantiation: fsck.c:odb_source_read_object_stream Unexecuted instantiation: grep.c:odb_source_read_object_stream Unexecuted instantiation: list-objects.c:odb_source_read_object_stream Unexecuted instantiation: log-tree.c:odb_source_read_object_stream Unexecuted instantiation: loose.c:odb_source_read_object_stream Unexecuted instantiation: merge-ort.c:odb_source_read_object_stream Unexecuted instantiation: midx.c:odb_source_read_object_stream Unexecuted instantiation: notes-cache.c:odb_source_read_object_stream Unexecuted instantiation: notes.c:odb_source_read_object_stream Unexecuted instantiation: pack-check.c:odb_source_read_object_stream Unexecuted instantiation: pack-mtimes.c:odb_source_read_object_stream Unexecuted instantiation: pack-revindex.c:odb_source_read_object_stream Unexecuted instantiation: send-pack.c:odb_source_read_object_stream Unexecuted instantiation: sequencer.c:odb_source_read_object_stream Unexecuted instantiation: transport-helper.c:odb_source_read_object_stream Unexecuted instantiation: unpack-trees.c:odb_source_read_object_stream Unexecuted instantiation: xdiff-interface.c:odb_source_read_object_stream Unexecuted instantiation: apply.c:odb_source_read_object_stream Unexecuted instantiation: entry.c:odb_source_read_object_stream Unexecuted instantiation: list-objects-filter.c:odb_source_read_object_stream Unexecuted instantiation: match-trees.c:odb_source_read_object_stream Unexecuted instantiation: rerere.c:odb_source_read_object_stream |
356 | | |
357 | | /* |
358 | | * Iterate through all objects contained in the given source and invoke the |
359 | | * callback function for each of them. Returning a non-zero code from the |
360 | | * callback function aborts iteration. There is no guarantee that objects |
361 | | * are only iterated over once. |
362 | | * |
363 | | * The optional `request` structure serves as a template for retrieving the |
364 | | * object info for each indvidual iterated object and will be populated as if |
365 | | * `odb_source_read_object_info()` was called on the object. It will not be |
366 | | * modified, the callback will instead be invoked with a separate `struct |
367 | | * object_info` for every object. Object info will not be read when passing a |
368 | | * `NULL` pointer. |
369 | | * |
370 | | * The flags is a bitfield of `ODB_FOR_EACH_OBJECT_*` flags. Not all flags may |
371 | | * apply to a specific backend, so whether or not they are honored is defined |
372 | | * by the implementation. |
373 | | * |
374 | | * Returns 0 when all objects have been iterated over, a negative error code in |
375 | | * case iteration has failed, or a non-zero value returned from the callback. |
376 | | */ |
377 | | static inline int odb_source_for_each_object(struct odb_source *source, |
378 | | const struct object_info *request, |
379 | | odb_for_each_object_cb cb, |
380 | | void *cb_data, |
381 | | unsigned flags) |
382 | 0 | { |
383 | 0 | return source->for_each_object(source, request, cb, cb_data, flags); |
384 | 0 | } Unexecuted instantiation: run-command.c:odb_source_for_each_object Unexecuted instantiation: config.c:odb_source_for_each_object Unexecuted instantiation: dir.c:odb_source_for_each_object Unexecuted instantiation: mailmap.c:odb_source_for_each_object Unexecuted instantiation: object-file.c:odb_source_for_each_object Unexecuted instantiation: object-name.c:odb_source_for_each_object Unexecuted instantiation: object.c:odb_source_for_each_object Unexecuted instantiation: odb.c:odb_source_for_each_object Unexecuted instantiation: source.c:odb_source_for_each_object Unexecuted instantiation: source-files.c:odb_source_for_each_object Unexecuted instantiation: streaming.c:odb_source_for_each_object Unexecuted instantiation: pack-write.c:odb_source_for_each_object Unexecuted instantiation: packfile.c:odb_source_for_each_object Unexecuted instantiation: path.c:odb_source_for_each_object Unexecuted instantiation: promisor-remote.c:odb_source_for_each_object Unexecuted instantiation: read-cache.c:odb_source_for_each_object Unexecuted instantiation: refs.c:odb_source_for_each_object Unexecuted instantiation: remote.c:odb_source_for_each_object Unexecuted instantiation: replace-object.c:odb_source_for_each_object Unexecuted instantiation: repo-settings.c:odb_source_for_each_object Unexecuted instantiation: repository.c:odb_source_for_each_object Unexecuted instantiation: revision.c:odb_source_for_each_object Unexecuted instantiation: setup.c:odb_source_for_each_object Unexecuted instantiation: shallow.c:odb_source_for_each_object Unexecuted instantiation: submodule-config.c:odb_source_for_each_object Unexecuted instantiation: submodule.c:odb_source_for_each_object Unexecuted instantiation: tag.c:odb_source_for_each_object Unexecuted instantiation: tmp-objdir.c:odb_source_for_each_object Unexecuted instantiation: tree-walk.c:odb_source_for_each_object Unexecuted instantiation: tree.c:odb_source_for_each_object Unexecuted instantiation: attr.c:odb_source_for_each_object Unexecuted instantiation: bisect.c:odb_source_for_each_object Unexecuted instantiation: bloom.c:odb_source_for_each_object Unexecuted instantiation: bundle-uri.c:odb_source_for_each_object Unexecuted instantiation: bundle.c:odb_source_for_each_object Unexecuted instantiation: cache-tree.c:odb_source_for_each_object Unexecuted instantiation: combine-diff.c:odb_source_for_each_object Unexecuted instantiation: commit-graph.c:odb_source_for_each_object Unexecuted instantiation: commit-reach.c:odb_source_for_each_object Unexecuted instantiation: commit.c:odb_source_for_each_object Unexecuted instantiation: connected.c:odb_source_for_each_object Unexecuted instantiation: convert.c:odb_source_for_each_object Unexecuted instantiation: diff.c:odb_source_for_each_object Unexecuted instantiation: diffcore-rename.c:odb_source_for_each_object Unexecuted instantiation: fetch-pack.c:odb_source_for_each_object Unexecuted instantiation: fsck.c:odb_source_for_each_object Unexecuted instantiation: grep.c:odb_source_for_each_object Unexecuted instantiation: list-objects.c:odb_source_for_each_object Unexecuted instantiation: log-tree.c:odb_source_for_each_object Unexecuted instantiation: loose.c:odb_source_for_each_object Unexecuted instantiation: merge-ort.c:odb_source_for_each_object Unexecuted instantiation: midx.c:odb_source_for_each_object Unexecuted instantiation: notes-cache.c:odb_source_for_each_object Unexecuted instantiation: notes.c:odb_source_for_each_object Unexecuted instantiation: pack-check.c:odb_source_for_each_object Unexecuted instantiation: pack-mtimes.c:odb_source_for_each_object Unexecuted instantiation: pack-revindex.c:odb_source_for_each_object Unexecuted instantiation: send-pack.c:odb_source_for_each_object Unexecuted instantiation: sequencer.c:odb_source_for_each_object Unexecuted instantiation: transport-helper.c:odb_source_for_each_object Unexecuted instantiation: unpack-trees.c:odb_source_for_each_object Unexecuted instantiation: xdiff-interface.c:odb_source_for_each_object Unexecuted instantiation: apply.c:odb_source_for_each_object Unexecuted instantiation: entry.c:odb_source_for_each_object Unexecuted instantiation: list-objects-filter.c:odb_source_for_each_object Unexecuted instantiation: match-trees.c:odb_source_for_each_object Unexecuted instantiation: rerere.c:odb_source_for_each_object |
385 | | |
386 | | /* |
387 | | * Freshen an object in the object database by updating its timestamp. |
388 | | * Returns 1 in case the object has been freshened, 0 in case the object does |
389 | | * not exist. |
390 | | */ |
391 | | static inline int odb_source_freshen_object(struct odb_source *source, |
392 | | const struct object_id *oid) |
393 | 0 | { |
394 | 0 | return source->freshen_object(source, oid); |
395 | 0 | } Unexecuted instantiation: run-command.c:odb_source_freshen_object Unexecuted instantiation: config.c:odb_source_freshen_object Unexecuted instantiation: dir.c:odb_source_freshen_object Unexecuted instantiation: mailmap.c:odb_source_freshen_object Unexecuted instantiation: object-file.c:odb_source_freshen_object Unexecuted instantiation: object-name.c:odb_source_freshen_object Unexecuted instantiation: object.c:odb_source_freshen_object Unexecuted instantiation: odb.c:odb_source_freshen_object Unexecuted instantiation: source.c:odb_source_freshen_object Unexecuted instantiation: source-files.c:odb_source_freshen_object Unexecuted instantiation: streaming.c:odb_source_freshen_object Unexecuted instantiation: pack-write.c:odb_source_freshen_object Unexecuted instantiation: packfile.c:odb_source_freshen_object Unexecuted instantiation: path.c:odb_source_freshen_object Unexecuted instantiation: promisor-remote.c:odb_source_freshen_object Unexecuted instantiation: read-cache.c:odb_source_freshen_object Unexecuted instantiation: refs.c:odb_source_freshen_object Unexecuted instantiation: remote.c:odb_source_freshen_object Unexecuted instantiation: replace-object.c:odb_source_freshen_object Unexecuted instantiation: repo-settings.c:odb_source_freshen_object Unexecuted instantiation: repository.c:odb_source_freshen_object Unexecuted instantiation: revision.c:odb_source_freshen_object Unexecuted instantiation: setup.c:odb_source_freshen_object Unexecuted instantiation: shallow.c:odb_source_freshen_object Unexecuted instantiation: submodule-config.c:odb_source_freshen_object Unexecuted instantiation: submodule.c:odb_source_freshen_object Unexecuted instantiation: tag.c:odb_source_freshen_object Unexecuted instantiation: tmp-objdir.c:odb_source_freshen_object Unexecuted instantiation: tree-walk.c:odb_source_freshen_object Unexecuted instantiation: tree.c:odb_source_freshen_object Unexecuted instantiation: attr.c:odb_source_freshen_object Unexecuted instantiation: bisect.c:odb_source_freshen_object Unexecuted instantiation: bloom.c:odb_source_freshen_object Unexecuted instantiation: bundle-uri.c:odb_source_freshen_object Unexecuted instantiation: bundle.c:odb_source_freshen_object Unexecuted instantiation: cache-tree.c:odb_source_freshen_object Unexecuted instantiation: combine-diff.c:odb_source_freshen_object Unexecuted instantiation: commit-graph.c:odb_source_freshen_object Unexecuted instantiation: commit-reach.c:odb_source_freshen_object Unexecuted instantiation: commit.c:odb_source_freshen_object Unexecuted instantiation: connected.c:odb_source_freshen_object Unexecuted instantiation: convert.c:odb_source_freshen_object Unexecuted instantiation: diff.c:odb_source_freshen_object Unexecuted instantiation: diffcore-rename.c:odb_source_freshen_object Unexecuted instantiation: fetch-pack.c:odb_source_freshen_object Unexecuted instantiation: fsck.c:odb_source_freshen_object Unexecuted instantiation: grep.c:odb_source_freshen_object Unexecuted instantiation: list-objects.c:odb_source_freshen_object Unexecuted instantiation: log-tree.c:odb_source_freshen_object Unexecuted instantiation: loose.c:odb_source_freshen_object Unexecuted instantiation: merge-ort.c:odb_source_freshen_object Unexecuted instantiation: midx.c:odb_source_freshen_object Unexecuted instantiation: notes-cache.c:odb_source_freshen_object Unexecuted instantiation: notes.c:odb_source_freshen_object Unexecuted instantiation: pack-check.c:odb_source_freshen_object Unexecuted instantiation: pack-mtimes.c:odb_source_freshen_object Unexecuted instantiation: pack-revindex.c:odb_source_freshen_object Unexecuted instantiation: send-pack.c:odb_source_freshen_object Unexecuted instantiation: sequencer.c:odb_source_freshen_object Unexecuted instantiation: transport-helper.c:odb_source_freshen_object Unexecuted instantiation: unpack-trees.c:odb_source_freshen_object Unexecuted instantiation: xdiff-interface.c:odb_source_freshen_object Unexecuted instantiation: apply.c:odb_source_freshen_object Unexecuted instantiation: entry.c:odb_source_freshen_object Unexecuted instantiation: list-objects-filter.c:odb_source_freshen_object Unexecuted instantiation: match-trees.c:odb_source_freshen_object Unexecuted instantiation: rerere.c:odb_source_freshen_object |
396 | | |
397 | | /* |
398 | | * Write an object into the object database source. Returns 0 on success, a |
399 | | * negative error code otherwise. Populates the given out pointers for the |
400 | | * object ID and the compatibility object ID, if non-NULL. |
401 | | */ |
402 | | static inline int odb_source_write_object(struct odb_source *source, |
403 | | const void *buf, unsigned long len, |
404 | | enum object_type type, |
405 | | struct object_id *oid, |
406 | | struct object_id *compat_oid, |
407 | | unsigned flags) |
408 | 0 | { |
409 | 0 | return source->write_object(source, buf, len, type, oid, |
410 | 0 | compat_oid, flags); |
411 | 0 | } Unexecuted instantiation: run-command.c:odb_source_write_object Unexecuted instantiation: config.c:odb_source_write_object Unexecuted instantiation: dir.c:odb_source_write_object Unexecuted instantiation: mailmap.c:odb_source_write_object Unexecuted instantiation: object-file.c:odb_source_write_object Unexecuted instantiation: object-name.c:odb_source_write_object Unexecuted instantiation: object.c:odb_source_write_object Unexecuted instantiation: odb.c:odb_source_write_object Unexecuted instantiation: source.c:odb_source_write_object Unexecuted instantiation: source-files.c:odb_source_write_object Unexecuted instantiation: streaming.c:odb_source_write_object Unexecuted instantiation: pack-write.c:odb_source_write_object Unexecuted instantiation: packfile.c:odb_source_write_object Unexecuted instantiation: path.c:odb_source_write_object Unexecuted instantiation: promisor-remote.c:odb_source_write_object Unexecuted instantiation: read-cache.c:odb_source_write_object Unexecuted instantiation: refs.c:odb_source_write_object Unexecuted instantiation: remote.c:odb_source_write_object Unexecuted instantiation: replace-object.c:odb_source_write_object Unexecuted instantiation: repo-settings.c:odb_source_write_object Unexecuted instantiation: repository.c:odb_source_write_object Unexecuted instantiation: revision.c:odb_source_write_object Unexecuted instantiation: setup.c:odb_source_write_object Unexecuted instantiation: shallow.c:odb_source_write_object Unexecuted instantiation: submodule-config.c:odb_source_write_object Unexecuted instantiation: submodule.c:odb_source_write_object Unexecuted instantiation: tag.c:odb_source_write_object Unexecuted instantiation: tmp-objdir.c:odb_source_write_object Unexecuted instantiation: tree-walk.c:odb_source_write_object Unexecuted instantiation: tree.c:odb_source_write_object Unexecuted instantiation: attr.c:odb_source_write_object Unexecuted instantiation: bisect.c:odb_source_write_object Unexecuted instantiation: bloom.c:odb_source_write_object Unexecuted instantiation: bundle-uri.c:odb_source_write_object Unexecuted instantiation: bundle.c:odb_source_write_object Unexecuted instantiation: cache-tree.c:odb_source_write_object Unexecuted instantiation: combine-diff.c:odb_source_write_object Unexecuted instantiation: commit-graph.c:odb_source_write_object Unexecuted instantiation: commit-reach.c:odb_source_write_object Unexecuted instantiation: commit.c:odb_source_write_object Unexecuted instantiation: connected.c:odb_source_write_object Unexecuted instantiation: convert.c:odb_source_write_object Unexecuted instantiation: diff.c:odb_source_write_object Unexecuted instantiation: diffcore-rename.c:odb_source_write_object Unexecuted instantiation: fetch-pack.c:odb_source_write_object Unexecuted instantiation: fsck.c:odb_source_write_object Unexecuted instantiation: grep.c:odb_source_write_object Unexecuted instantiation: list-objects.c:odb_source_write_object Unexecuted instantiation: log-tree.c:odb_source_write_object Unexecuted instantiation: loose.c:odb_source_write_object Unexecuted instantiation: merge-ort.c:odb_source_write_object Unexecuted instantiation: midx.c:odb_source_write_object Unexecuted instantiation: notes-cache.c:odb_source_write_object Unexecuted instantiation: notes.c:odb_source_write_object Unexecuted instantiation: pack-check.c:odb_source_write_object Unexecuted instantiation: pack-mtimes.c:odb_source_write_object Unexecuted instantiation: pack-revindex.c:odb_source_write_object Unexecuted instantiation: send-pack.c:odb_source_write_object Unexecuted instantiation: sequencer.c:odb_source_write_object Unexecuted instantiation: transport-helper.c:odb_source_write_object Unexecuted instantiation: unpack-trees.c:odb_source_write_object Unexecuted instantiation: xdiff-interface.c:odb_source_write_object Unexecuted instantiation: apply.c:odb_source_write_object Unexecuted instantiation: entry.c:odb_source_write_object Unexecuted instantiation: list-objects-filter.c:odb_source_write_object Unexecuted instantiation: match-trees.c:odb_source_write_object Unexecuted instantiation: rerere.c:odb_source_write_object |
412 | | |
413 | | /* |
414 | | * Write an object into the object database source via a stream. The overall |
415 | | * length of the object must be known in advance. |
416 | | * |
417 | | * Return 0 on success, a negative error code otherwise. Populates the given |
418 | | * out pointer for the object ID. |
419 | | */ |
420 | | static inline int odb_source_write_object_stream(struct odb_source *source, |
421 | | struct odb_write_stream *stream, |
422 | | size_t len, |
423 | | struct object_id *oid) |
424 | 0 | { |
425 | 0 | return source->write_object_stream(source, stream, len, oid); |
426 | 0 | } Unexecuted instantiation: run-command.c:odb_source_write_object_stream Unexecuted instantiation: config.c:odb_source_write_object_stream Unexecuted instantiation: dir.c:odb_source_write_object_stream Unexecuted instantiation: mailmap.c:odb_source_write_object_stream Unexecuted instantiation: object-file.c:odb_source_write_object_stream Unexecuted instantiation: object-name.c:odb_source_write_object_stream Unexecuted instantiation: object.c:odb_source_write_object_stream Unexecuted instantiation: odb.c:odb_source_write_object_stream Unexecuted instantiation: source.c:odb_source_write_object_stream Unexecuted instantiation: source-files.c:odb_source_write_object_stream Unexecuted instantiation: streaming.c:odb_source_write_object_stream Unexecuted instantiation: pack-write.c:odb_source_write_object_stream Unexecuted instantiation: packfile.c:odb_source_write_object_stream Unexecuted instantiation: path.c:odb_source_write_object_stream Unexecuted instantiation: promisor-remote.c:odb_source_write_object_stream Unexecuted instantiation: read-cache.c:odb_source_write_object_stream Unexecuted instantiation: refs.c:odb_source_write_object_stream Unexecuted instantiation: remote.c:odb_source_write_object_stream Unexecuted instantiation: replace-object.c:odb_source_write_object_stream Unexecuted instantiation: repo-settings.c:odb_source_write_object_stream Unexecuted instantiation: repository.c:odb_source_write_object_stream Unexecuted instantiation: revision.c:odb_source_write_object_stream Unexecuted instantiation: setup.c:odb_source_write_object_stream Unexecuted instantiation: shallow.c:odb_source_write_object_stream Unexecuted instantiation: submodule-config.c:odb_source_write_object_stream Unexecuted instantiation: submodule.c:odb_source_write_object_stream Unexecuted instantiation: tag.c:odb_source_write_object_stream Unexecuted instantiation: tmp-objdir.c:odb_source_write_object_stream Unexecuted instantiation: tree-walk.c:odb_source_write_object_stream Unexecuted instantiation: tree.c:odb_source_write_object_stream Unexecuted instantiation: attr.c:odb_source_write_object_stream Unexecuted instantiation: bisect.c:odb_source_write_object_stream Unexecuted instantiation: bloom.c:odb_source_write_object_stream Unexecuted instantiation: bundle-uri.c:odb_source_write_object_stream Unexecuted instantiation: bundle.c:odb_source_write_object_stream Unexecuted instantiation: cache-tree.c:odb_source_write_object_stream Unexecuted instantiation: combine-diff.c:odb_source_write_object_stream Unexecuted instantiation: commit-graph.c:odb_source_write_object_stream Unexecuted instantiation: commit-reach.c:odb_source_write_object_stream Unexecuted instantiation: commit.c:odb_source_write_object_stream Unexecuted instantiation: connected.c:odb_source_write_object_stream Unexecuted instantiation: convert.c:odb_source_write_object_stream Unexecuted instantiation: diff.c:odb_source_write_object_stream Unexecuted instantiation: diffcore-rename.c:odb_source_write_object_stream Unexecuted instantiation: fetch-pack.c:odb_source_write_object_stream Unexecuted instantiation: fsck.c:odb_source_write_object_stream Unexecuted instantiation: grep.c:odb_source_write_object_stream Unexecuted instantiation: list-objects.c:odb_source_write_object_stream Unexecuted instantiation: log-tree.c:odb_source_write_object_stream Unexecuted instantiation: loose.c:odb_source_write_object_stream Unexecuted instantiation: merge-ort.c:odb_source_write_object_stream Unexecuted instantiation: midx.c:odb_source_write_object_stream Unexecuted instantiation: notes-cache.c:odb_source_write_object_stream Unexecuted instantiation: notes.c:odb_source_write_object_stream Unexecuted instantiation: pack-check.c:odb_source_write_object_stream Unexecuted instantiation: pack-mtimes.c:odb_source_write_object_stream Unexecuted instantiation: pack-revindex.c:odb_source_write_object_stream Unexecuted instantiation: send-pack.c:odb_source_write_object_stream Unexecuted instantiation: sequencer.c:odb_source_write_object_stream Unexecuted instantiation: transport-helper.c:odb_source_write_object_stream Unexecuted instantiation: unpack-trees.c:odb_source_write_object_stream Unexecuted instantiation: xdiff-interface.c:odb_source_write_object_stream Unexecuted instantiation: apply.c:odb_source_write_object_stream Unexecuted instantiation: entry.c:odb_source_write_object_stream Unexecuted instantiation: list-objects-filter.c:odb_source_write_object_stream Unexecuted instantiation: match-trees.c:odb_source_write_object_stream Unexecuted instantiation: rerere.c:odb_source_write_object_stream |
427 | | |
428 | | /* |
429 | | * Read the list of alternative object database sources from the given backend |
430 | | * and populate the `strvec` with them. The listing is not recursive -- that |
431 | | * is, if any of the yielded alternate sources has alternates itself, those |
432 | | * will not be yielded as part of this function call. |
433 | | * |
434 | | * Return 0 on success, a negative error code otherwise. |
435 | | */ |
436 | | static inline int odb_source_read_alternates(struct odb_source *source, |
437 | | struct strvec *out) |
438 | 0 | { |
439 | 0 | return source->read_alternates(source, out); |
440 | 0 | } Unexecuted instantiation: run-command.c:odb_source_read_alternates Unexecuted instantiation: config.c:odb_source_read_alternates Unexecuted instantiation: dir.c:odb_source_read_alternates Unexecuted instantiation: mailmap.c:odb_source_read_alternates Unexecuted instantiation: object-file.c:odb_source_read_alternates Unexecuted instantiation: object-name.c:odb_source_read_alternates Unexecuted instantiation: object.c:odb_source_read_alternates Unexecuted instantiation: odb.c:odb_source_read_alternates Unexecuted instantiation: source.c:odb_source_read_alternates Unexecuted instantiation: source-files.c:odb_source_read_alternates Unexecuted instantiation: streaming.c:odb_source_read_alternates Unexecuted instantiation: pack-write.c:odb_source_read_alternates Unexecuted instantiation: packfile.c:odb_source_read_alternates Unexecuted instantiation: path.c:odb_source_read_alternates Unexecuted instantiation: promisor-remote.c:odb_source_read_alternates Unexecuted instantiation: read-cache.c:odb_source_read_alternates Unexecuted instantiation: refs.c:odb_source_read_alternates Unexecuted instantiation: remote.c:odb_source_read_alternates Unexecuted instantiation: replace-object.c:odb_source_read_alternates Unexecuted instantiation: repo-settings.c:odb_source_read_alternates Unexecuted instantiation: repository.c:odb_source_read_alternates Unexecuted instantiation: revision.c:odb_source_read_alternates Unexecuted instantiation: setup.c:odb_source_read_alternates Unexecuted instantiation: shallow.c:odb_source_read_alternates Unexecuted instantiation: submodule-config.c:odb_source_read_alternates Unexecuted instantiation: submodule.c:odb_source_read_alternates Unexecuted instantiation: tag.c:odb_source_read_alternates Unexecuted instantiation: tmp-objdir.c:odb_source_read_alternates Unexecuted instantiation: tree-walk.c:odb_source_read_alternates Unexecuted instantiation: tree.c:odb_source_read_alternates Unexecuted instantiation: attr.c:odb_source_read_alternates Unexecuted instantiation: bisect.c:odb_source_read_alternates Unexecuted instantiation: bloom.c:odb_source_read_alternates Unexecuted instantiation: bundle-uri.c:odb_source_read_alternates Unexecuted instantiation: bundle.c:odb_source_read_alternates Unexecuted instantiation: cache-tree.c:odb_source_read_alternates Unexecuted instantiation: combine-diff.c:odb_source_read_alternates Unexecuted instantiation: commit-graph.c:odb_source_read_alternates Unexecuted instantiation: commit-reach.c:odb_source_read_alternates Unexecuted instantiation: commit.c:odb_source_read_alternates Unexecuted instantiation: connected.c:odb_source_read_alternates Unexecuted instantiation: convert.c:odb_source_read_alternates Unexecuted instantiation: diff.c:odb_source_read_alternates Unexecuted instantiation: diffcore-rename.c:odb_source_read_alternates Unexecuted instantiation: fetch-pack.c:odb_source_read_alternates Unexecuted instantiation: fsck.c:odb_source_read_alternates Unexecuted instantiation: grep.c:odb_source_read_alternates Unexecuted instantiation: list-objects.c:odb_source_read_alternates Unexecuted instantiation: log-tree.c:odb_source_read_alternates Unexecuted instantiation: loose.c:odb_source_read_alternates Unexecuted instantiation: merge-ort.c:odb_source_read_alternates Unexecuted instantiation: midx.c:odb_source_read_alternates Unexecuted instantiation: notes-cache.c:odb_source_read_alternates Unexecuted instantiation: notes.c:odb_source_read_alternates Unexecuted instantiation: pack-check.c:odb_source_read_alternates Unexecuted instantiation: pack-mtimes.c:odb_source_read_alternates Unexecuted instantiation: pack-revindex.c:odb_source_read_alternates Unexecuted instantiation: send-pack.c:odb_source_read_alternates Unexecuted instantiation: sequencer.c:odb_source_read_alternates Unexecuted instantiation: transport-helper.c:odb_source_read_alternates Unexecuted instantiation: unpack-trees.c:odb_source_read_alternates Unexecuted instantiation: xdiff-interface.c:odb_source_read_alternates Unexecuted instantiation: apply.c:odb_source_read_alternates Unexecuted instantiation: entry.c:odb_source_read_alternates Unexecuted instantiation: list-objects-filter.c:odb_source_read_alternates Unexecuted instantiation: match-trees.c:odb_source_read_alternates Unexecuted instantiation: rerere.c:odb_source_read_alternates |
441 | | |
442 | | /* |
443 | | * Write and persist a new alternate object database source for the given |
444 | | * source. Any preexisting alternates are expected to stay valid, and the new |
445 | | * alternate shall be appended to the end of the list. |
446 | | * |
447 | | * Returns 0 on success, a negative error code otherwise. |
448 | | */ |
449 | | static inline int odb_source_write_alternate(struct odb_source *source, |
450 | | const char *alternate) |
451 | 0 | { |
452 | 0 | return source->write_alternate(source, alternate); |
453 | 0 | } Unexecuted instantiation: run-command.c:odb_source_write_alternate Unexecuted instantiation: config.c:odb_source_write_alternate Unexecuted instantiation: dir.c:odb_source_write_alternate Unexecuted instantiation: mailmap.c:odb_source_write_alternate Unexecuted instantiation: object-file.c:odb_source_write_alternate Unexecuted instantiation: object-name.c:odb_source_write_alternate Unexecuted instantiation: object.c:odb_source_write_alternate Unexecuted instantiation: odb.c:odb_source_write_alternate Unexecuted instantiation: source.c:odb_source_write_alternate Unexecuted instantiation: source-files.c:odb_source_write_alternate Unexecuted instantiation: streaming.c:odb_source_write_alternate Unexecuted instantiation: pack-write.c:odb_source_write_alternate Unexecuted instantiation: packfile.c:odb_source_write_alternate Unexecuted instantiation: path.c:odb_source_write_alternate Unexecuted instantiation: promisor-remote.c:odb_source_write_alternate Unexecuted instantiation: read-cache.c:odb_source_write_alternate Unexecuted instantiation: refs.c:odb_source_write_alternate Unexecuted instantiation: remote.c:odb_source_write_alternate Unexecuted instantiation: replace-object.c:odb_source_write_alternate Unexecuted instantiation: repo-settings.c:odb_source_write_alternate Unexecuted instantiation: repository.c:odb_source_write_alternate Unexecuted instantiation: revision.c:odb_source_write_alternate Unexecuted instantiation: setup.c:odb_source_write_alternate Unexecuted instantiation: shallow.c:odb_source_write_alternate Unexecuted instantiation: submodule-config.c:odb_source_write_alternate Unexecuted instantiation: submodule.c:odb_source_write_alternate Unexecuted instantiation: tag.c:odb_source_write_alternate Unexecuted instantiation: tmp-objdir.c:odb_source_write_alternate Unexecuted instantiation: tree-walk.c:odb_source_write_alternate Unexecuted instantiation: tree.c:odb_source_write_alternate Unexecuted instantiation: attr.c:odb_source_write_alternate Unexecuted instantiation: bisect.c:odb_source_write_alternate Unexecuted instantiation: bloom.c:odb_source_write_alternate Unexecuted instantiation: bundle-uri.c:odb_source_write_alternate Unexecuted instantiation: bundle.c:odb_source_write_alternate Unexecuted instantiation: cache-tree.c:odb_source_write_alternate Unexecuted instantiation: combine-diff.c:odb_source_write_alternate Unexecuted instantiation: commit-graph.c:odb_source_write_alternate Unexecuted instantiation: commit-reach.c:odb_source_write_alternate Unexecuted instantiation: commit.c:odb_source_write_alternate Unexecuted instantiation: connected.c:odb_source_write_alternate Unexecuted instantiation: convert.c:odb_source_write_alternate Unexecuted instantiation: diff.c:odb_source_write_alternate Unexecuted instantiation: diffcore-rename.c:odb_source_write_alternate Unexecuted instantiation: fetch-pack.c:odb_source_write_alternate Unexecuted instantiation: fsck.c:odb_source_write_alternate Unexecuted instantiation: grep.c:odb_source_write_alternate Unexecuted instantiation: list-objects.c:odb_source_write_alternate Unexecuted instantiation: log-tree.c:odb_source_write_alternate Unexecuted instantiation: loose.c:odb_source_write_alternate Unexecuted instantiation: merge-ort.c:odb_source_write_alternate Unexecuted instantiation: midx.c:odb_source_write_alternate Unexecuted instantiation: notes-cache.c:odb_source_write_alternate Unexecuted instantiation: notes.c:odb_source_write_alternate Unexecuted instantiation: pack-check.c:odb_source_write_alternate Unexecuted instantiation: pack-mtimes.c:odb_source_write_alternate Unexecuted instantiation: pack-revindex.c:odb_source_write_alternate Unexecuted instantiation: send-pack.c:odb_source_write_alternate Unexecuted instantiation: sequencer.c:odb_source_write_alternate Unexecuted instantiation: transport-helper.c:odb_source_write_alternate Unexecuted instantiation: unpack-trees.c:odb_source_write_alternate Unexecuted instantiation: xdiff-interface.c:odb_source_write_alternate Unexecuted instantiation: apply.c:odb_source_write_alternate Unexecuted instantiation: entry.c:odb_source_write_alternate Unexecuted instantiation: list-objects-filter.c:odb_source_write_alternate Unexecuted instantiation: match-trees.c:odb_source_write_alternate Unexecuted instantiation: rerere.c:odb_source_write_alternate |
454 | | |
455 | | /* |
456 | | * Create a new transaction that can be used to write objects into a temporary |
457 | | * staging area. The objects will only be persisted when the transaction is |
458 | | * committed. |
459 | | * |
460 | | * Returns 0 on success, a negative error code otherwise. |
461 | | */ |
462 | | static inline int odb_source_begin_transaction(struct odb_source *source, |
463 | | struct odb_transaction **out) |
464 | 0 | { |
465 | 0 | return source->begin_transaction(source, out); |
466 | 0 | } Unexecuted instantiation: run-command.c:odb_source_begin_transaction Unexecuted instantiation: config.c:odb_source_begin_transaction Unexecuted instantiation: dir.c:odb_source_begin_transaction Unexecuted instantiation: mailmap.c:odb_source_begin_transaction Unexecuted instantiation: object-file.c:odb_source_begin_transaction Unexecuted instantiation: object-name.c:odb_source_begin_transaction Unexecuted instantiation: object.c:odb_source_begin_transaction Unexecuted instantiation: odb.c:odb_source_begin_transaction Unexecuted instantiation: source.c:odb_source_begin_transaction Unexecuted instantiation: source-files.c:odb_source_begin_transaction Unexecuted instantiation: streaming.c:odb_source_begin_transaction Unexecuted instantiation: pack-write.c:odb_source_begin_transaction Unexecuted instantiation: packfile.c:odb_source_begin_transaction Unexecuted instantiation: path.c:odb_source_begin_transaction Unexecuted instantiation: promisor-remote.c:odb_source_begin_transaction Unexecuted instantiation: read-cache.c:odb_source_begin_transaction Unexecuted instantiation: refs.c:odb_source_begin_transaction Unexecuted instantiation: remote.c:odb_source_begin_transaction Unexecuted instantiation: replace-object.c:odb_source_begin_transaction Unexecuted instantiation: repo-settings.c:odb_source_begin_transaction Unexecuted instantiation: repository.c:odb_source_begin_transaction Unexecuted instantiation: revision.c:odb_source_begin_transaction Unexecuted instantiation: setup.c:odb_source_begin_transaction Unexecuted instantiation: shallow.c:odb_source_begin_transaction Unexecuted instantiation: submodule-config.c:odb_source_begin_transaction Unexecuted instantiation: submodule.c:odb_source_begin_transaction Unexecuted instantiation: tag.c:odb_source_begin_transaction Unexecuted instantiation: tmp-objdir.c:odb_source_begin_transaction Unexecuted instantiation: tree-walk.c:odb_source_begin_transaction Unexecuted instantiation: tree.c:odb_source_begin_transaction Unexecuted instantiation: attr.c:odb_source_begin_transaction Unexecuted instantiation: bisect.c:odb_source_begin_transaction Unexecuted instantiation: bloom.c:odb_source_begin_transaction Unexecuted instantiation: bundle-uri.c:odb_source_begin_transaction Unexecuted instantiation: bundle.c:odb_source_begin_transaction Unexecuted instantiation: cache-tree.c:odb_source_begin_transaction Unexecuted instantiation: combine-diff.c:odb_source_begin_transaction Unexecuted instantiation: commit-graph.c:odb_source_begin_transaction Unexecuted instantiation: commit-reach.c:odb_source_begin_transaction Unexecuted instantiation: commit.c:odb_source_begin_transaction Unexecuted instantiation: connected.c:odb_source_begin_transaction Unexecuted instantiation: convert.c:odb_source_begin_transaction Unexecuted instantiation: diff.c:odb_source_begin_transaction Unexecuted instantiation: diffcore-rename.c:odb_source_begin_transaction Unexecuted instantiation: fetch-pack.c:odb_source_begin_transaction Unexecuted instantiation: fsck.c:odb_source_begin_transaction Unexecuted instantiation: grep.c:odb_source_begin_transaction Unexecuted instantiation: list-objects.c:odb_source_begin_transaction Unexecuted instantiation: log-tree.c:odb_source_begin_transaction Unexecuted instantiation: loose.c:odb_source_begin_transaction Unexecuted instantiation: merge-ort.c:odb_source_begin_transaction Unexecuted instantiation: midx.c:odb_source_begin_transaction Unexecuted instantiation: notes-cache.c:odb_source_begin_transaction Unexecuted instantiation: notes.c:odb_source_begin_transaction Unexecuted instantiation: pack-check.c:odb_source_begin_transaction Unexecuted instantiation: pack-mtimes.c:odb_source_begin_transaction Unexecuted instantiation: pack-revindex.c:odb_source_begin_transaction Unexecuted instantiation: send-pack.c:odb_source_begin_transaction Unexecuted instantiation: sequencer.c:odb_source_begin_transaction Unexecuted instantiation: transport-helper.c:odb_source_begin_transaction Unexecuted instantiation: unpack-trees.c:odb_source_begin_transaction Unexecuted instantiation: xdiff-interface.c:odb_source_begin_transaction Unexecuted instantiation: apply.c:odb_source_begin_transaction Unexecuted instantiation: entry.c:odb_source_begin_transaction Unexecuted instantiation: list-objects-filter.c:odb_source_begin_transaction Unexecuted instantiation: match-trees.c:odb_source_begin_transaction Unexecuted instantiation: rerere.c:odb_source_begin_transaction |
467 | | |
468 | | #endif |