else
packed_refs_file = git_path("packed-refs");
f = fopen(packed_refs_file, "r");
else
packed_refs_file = git_path("packed-refs");
f = fopen(packed_refs_file, "r");
path = git_path_submodule(submodule, "%s", base);
else
path = git_path("%s", base);
path = git_path_submodule(submodule, "%s", base);
else
path = git_path("%s", base);
if (pathlen < 6 || memcmp(name + pathlen - 6, "/.git/", 6))
die("Oops");
name[pathlen - 6] = '\0'; /* make it path to the submodule */
if (pathlen < 6 || memcmp(name + pathlen - 6, "/.git/", 6))
die("Oops");
name[pathlen - 6] = '\0'; /* make it path to the submodule */
ref = search_ref_array(array, refname);
if (ref != NULL) {
memcpy(sha1, ref->sha1, 20);
ref = search_ref_array(array, refname);
if (ref != NULL) {
memcpy(sha1, ref->sha1, 20);
struct ref_entry *entry = search_ref_array(packed, refname);
if (entry) {
hashcpy(sha1, entry->sha1);
struct ref_entry *entry = search_ref_array(packed, refname);
if (entry) {
hashcpy(sha1, entry->sha1);
struct ref_entry *r = search_ref_array(array, refname);
if (r != NULL && r->flag & REF_KNOWS_PEELED) {
struct ref_entry *r = search_ref_array(array, refname);
if (r != NULL && r->flag & REF_KNOWS_PEELED) {
int trim, int flags, void *cb_data)
{
int retval = 0, i, p = 0, l = 0;
int trim, int flags, void *cb_data)
{
int retval = 0, i, p = 0, l = 0;
- struct ref_array *packed = get_packed_refs(submodule);
- struct ref_array *loose = get_loose_refs(submodule);
+ struct ref_cache *refs = get_ref_cache(submodule);
+ struct ref_array *packed = get_packed_refs(refs);
+ struct ref_array *loose = get_loose_refs(refs);
struct stat loginfo;
int log = !lstat(git_path("logs/%s", oldrefname), &loginfo);
const char *symref = NULL;
struct stat loginfo;
int log = !lstat(git_path("logs/%s", oldrefname), &loginfo);
const char *symref = NULL;
if (log && S_ISLNK(loginfo.st_mode))
return error("reflog for %s is a symlink", oldrefname);
if (log && S_ISLNK(loginfo.st_mode))
return error("reflog for %s is a symlink", oldrefname);