MCPcopy Create free account
hub / github.com/git/git / files_downcast

Function files_downcast

refs/files-backend.c:159–176  ·  view source on GitHub ↗

* Downcast ref_store to files_ref_store. Die if ref_store is not a * files_ref_store. required_flags is compared with ref_store's * store_flags to ensure the ref_store has all required capabilities. * "caller" is used in any necessary error messages. */

Source from the content-addressed store, hash-verified

157 * "caller" is used in any necessary error messages.
158 */
159static struct files_ref_store *files_downcast(struct ref_store *ref_store,
160 unsigned int required_flags,
161 const char *caller)
162{
163 struct files_ref_store *refs;
164
165 if (ref_store->be != &refs_be_files)
166 BUG("ref_store is type \"%s\" not \"files\" in %s",
167 ref_store->be->name, caller);
168
169 refs = (struct files_ref_store *)ref_store;
170
171 if ((refs->store_flags & required_flags) != required_flags)
172 BUG("operation %s requires abilities 0x%x, but only have 0x%x",
173 caller, required_flags, refs->store_flags);
174
175 return refs;
176}
177
178static void files_ref_store_release(struct ref_store *ref_store)
179{

Callers 15

files_ref_store_releaseFunction · 0.85
loose_fill_ref_dirFunction · 0.85
read_ref_internalFunction · 0.85
files_ref_iterator_beginFunction · 0.85
files_optimizeFunction · 0.85
files_optimize_requiredFunction · 0.85
files_copy_or_rename_refFunction · 0.85
files_create_reflogFunction · 0.85
files_reflog_existsFunction · 0.85
files_delete_reflogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected