diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/branch.c | 2 | ||||
-rw-r--r-- | src/clone.c | 2 | ||||
-rw-r--r-- | src/notes.c | 2 | ||||
-rw-r--r-- | src/pack-objects.c | 3 | ||||
-rw-r--r-- | src/reflog.c | 18 | ||||
-rw-r--r-- | src/refs.c | 46 | ||||
-rw-r--r-- | src/remote.c | 6 | ||||
-rw-r--r-- | src/repository.c | 18 | ||||
-rw-r--r-- | src/reset.c | 6 | ||||
-rw-r--r-- | src/revparse.c | 12 | ||||
-rw-r--r-- | src/revwalk.c | 2 | ||||
-rw-r--r-- | src/stash.c | 8 | ||||
-rw-r--r-- | src/submodule.c | 6 | ||||
-rw-r--r-- | src/tag.c | 8 | ||||
-rw-r--r-- | src/transports/local.c | 2 | ||||
-rw-r--r-- | src/transports/smart_protocol.c | 2 |
16 files changed, 72 insertions, 71 deletions
diff --git a/src/branch.c b/src/branch.c index c6173caca..87ee7084f 100644 --- a/src/branch.c +++ b/src/branch.c @@ -77,7 +77,7 @@ int git_branch_create( if (git_buf_joinpath(&canonical_branch_name, GIT_REFS_HEADS_DIR, branch_name) < 0) goto cleanup; - error = git_reference_create_oid(&branch, repository, + error = git_reference_create(&branch, repository, git_buf_cstr(&canonical_branch_name), git_object_id(commit), force); if (!error) diff --git a/src/clone.c b/src/clone.c index 9ef6f8100..ea644dd11 100644 --- a/src/clone.c +++ b/src/clone.c @@ -122,7 +122,7 @@ static int reference_matches_remote_head( if (git_buf_len(&head_info->branchname) > 0) return 0; - if (git_reference_name_to_oid( + if (git_reference_name_to_id( &oid, head_info->repo, reference_name) < 0) { diff --git a/src/notes.c b/src/notes.c index 81e4e5073..75848465e 100644 --- a/src/notes.c +++ b/src/notes.c @@ -406,7 +406,7 @@ static int retrieve_note_tree_and_commit( if ((error = normalize_namespace(notes_ref, repo)) < 0) return error; - if ((error = git_reference_name_to_oid(&oid, repo, *notes_ref)) < 0) + if ((error = git_reference_name_to_id(&oid, repo, *notes_ref)) < 0) return error; if (git_commit_lookup(commit_out, repo, &oid) < 0) diff --git a/src/pack-objects.c b/src/pack-objects.c index a146dc048..5db4bc9ae 100644 --- a/src/pack-objects.c +++ b/src/pack-objects.c @@ -136,10 +136,11 @@ on_error: return -1; } -void git_packbuilder_set_threads(git_packbuilder *pb, unsigned int n) +unsigned int git_packbuilder_set_threads(git_packbuilder *pb, unsigned int n) { assert(pb); pb->nr_threads = n; + return pb->nr_threads; } static void rehash(git_packbuilder *pb) diff --git a/src/reflog.c b/src/reflog.c index 7b07c6a9f..72a34f695 100644 --- a/src/reflog.c +++ b/src/reflog.c @@ -10,7 +10,7 @@ #include "filebuf.h" #include "signature.h" -static int reflog_init(git_reflog **reflog, git_reference *ref) +static int reflog_init(git_reflog **reflog, const git_reference *ref) { git_reflog *log; @@ -180,7 +180,7 @@ void git_reflog_free(git_reflog *reflog) git__free(reflog); } -static int retrieve_reflog_path(git_buf *path, git_reference *ref) +static int retrieve_reflog_path(git_buf *path, const git_reference *ref) { return git_buf_join_n(path, '/', 3, git_reference_owner(ref)->path_repository, GIT_REFLOG_DIR, ref->name); @@ -201,7 +201,7 @@ static int create_new_reflog_file(const char *filepath) return p_close(fd); } -int git_reflog_read(git_reflog **reflog, git_reference *ref) +int git_reflog_read(git_reflog **reflog, const git_reference *ref) { int error = -1; git_buf log_path = GIT_BUF_INIT; @@ -405,10 +405,10 @@ int git_reflog_delete(git_reference *ref) return error; } -unsigned int git_reflog_entrycount(git_reflog *reflog) +size_t git_reflog_entrycount(git_reflog *reflog) { assert(reflog); - return (unsigned int)reflog->entries.length; + return reflog->entries.length; } const git_reflog_entry * git_reflog_entry_byindex(git_reflog *reflog, size_t idx) @@ -425,25 +425,25 @@ const git_reflog_entry * git_reflog_entry_byindex(git_reflog *reflog, size_t idx return git_vector_get(&reflog->entries, pos); } -const git_oid * git_reflog_entry_oidold(const git_reflog_entry *entry) +const git_oid * git_reflog_entry_id_old(const git_reflog_entry *entry) { assert(entry); return &entry->oid_old; } -const git_oid * git_reflog_entry_oidnew(const git_reflog_entry *entry) +const git_oid * git_reflog_entry_id_new(const git_reflog_entry *entry) { assert(entry); return &entry->oid_cur; } -git_signature * git_reflog_entry_committer(const git_reflog_entry *entry) +const git_signature * git_reflog_entry_committer(const git_reflog_entry *entry) { assert(entry); return entry->committer; } -char * git_reflog_entry_msg(const git_reflog_entry *entry) +const char * git_reflog_entry_message(const git_reflog_entry *entry) { assert(entry); return entry->msg; diff --git a/src/refs.c b/src/refs.c index 97c97563e..1aaf4f60f 100644 --- a/src/refs.c +++ b/src/refs.c @@ -1074,7 +1074,7 @@ int git_reference_lookup(git_reference **ref_out, return git_reference_lookup_resolved(ref_out, repo, name, 0); } -int git_reference_name_to_oid( +int git_reference_name_to_id( git_oid *out, git_repository *repo, const char *name) { int error; @@ -1083,7 +1083,7 @@ int git_reference_name_to_oid( if ((error = git_reference_lookup_resolved(&ref, repo, name, -1)) < 0) return error; - git_oid_cpy(out, git_reference_oid(ref)); + git_oid_cpy(out, git_reference_target(ref)); git_reference_free(ref); return 0; } @@ -1153,7 +1153,7 @@ int git_reference_lookup_resolved( /** * Getters */ -git_ref_t git_reference_type(git_reference *ref) +git_ref_t git_reference_type(const git_reference *ref) { assert(ref); @@ -1172,19 +1172,19 @@ int git_reference_is_packed(git_reference *ref) return !!(ref->flags & GIT_REF_PACKED); } -const char *git_reference_name(git_reference *ref) +const char *git_reference_name(const git_reference *ref) { assert(ref); return ref->name; } -git_repository *git_reference_owner(git_reference *ref) +git_repository *git_reference_owner(const git_reference *ref) { assert(ref); return ref->owner; } -const git_oid *git_reference_oid(git_reference *ref) +const git_oid *git_reference_target(const git_reference *ref) { assert(ref); @@ -1194,7 +1194,7 @@ const git_oid *git_reference_oid(git_reference *ref) return &ref->target.oid; } -const char *git_reference_target(git_reference *ref) +const char *git_reference_symbolic_target(const git_reference *ref) { assert(ref); @@ -1204,7 +1204,7 @@ const char *git_reference_target(git_reference *ref) return ref->target.symbolic; } -int git_reference_create_symbolic( +int git_reference_symbolic_create( git_reference **ref_out, git_repository *repo, const char *name, @@ -1231,7 +1231,7 @@ int git_reference_create_symbolic( /* set the target; this will normalize the name automatically * and write the reference on disk */ - if (git_reference_set_target(ref, target) < 0) { + if (git_reference_symbolic_set_target(ref, target) < 0) { git_reference_free(ref); return -1; } @@ -1244,7 +1244,7 @@ int git_reference_create_symbolic( return 0; } -int git_reference_create_oid( +int git_reference_create( git_reference **ref_out, git_repository *repo, const char *name, @@ -1270,7 +1270,7 @@ int git_reference_create_oid( ref->flags |= GIT_REF_OID; /* set the oid; this will write the reference on disk */ - if (git_reference_set_oid(ref, id) < 0) { + if (git_reference_set_target(ref, id) < 0) { git_reference_free(ref); return -1; } @@ -1292,7 +1292,7 @@ int git_reference_create_oid( * We do not repack packed references because of performance * reasons. */ -int git_reference_set_oid(git_reference *ref, const git_oid *id) +int git_reference_set_target(git_reference *ref, const git_oid *id) { git_odb *odb = NULL; @@ -1328,7 +1328,7 @@ int git_reference_set_oid(git_reference *ref, const git_oid *id) * a pack. We just change the target in memory * and overwrite the file on disk. */ -int git_reference_set_target(git_reference *ref, const char *target) +int git_reference_symbolic_set_target(git_reference *ref, const char *target) { char normalized[GIT_REFNAME_MAX]; @@ -1397,10 +1397,10 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force) * Finally we can create the new reference. */ if (ref->flags & GIT_REF_SYMBOLIC) { - result = git_reference_create_symbolic( + result = git_reference_symbolic_create( NULL, ref->owner, new_name, ref->target.symbolic, force); } else { - result = git_reference_create_oid( + result = git_reference_create( NULL, ref->owner, new_name, &ref->target.oid, force); } @@ -1444,10 +1444,10 @@ rollback: * Try to create the old reference again, ignore failures */ if (ref->flags & GIT_REF_SYMBOLIC) - git_reference_create_symbolic( + git_reference_symbolic_create( NULL, ref->owner, ref->name, ref->target.symbolic, 0); else - git_reference_create_oid( + git_reference_create( NULL, ref->owner, ref->name, &ref->target.oid, 0); /* The reference is no longer packed */ @@ -1457,7 +1457,7 @@ rollback: return -1; } -int git_reference_resolve(git_reference **ref_out, git_reference *ref) +int git_reference_resolve(git_reference **ref_out, const git_reference *ref) { if (ref->flags & GIT_REF_OID) return git_reference_lookup(ref_out, ref->owner, ref->name); @@ -1797,7 +1797,7 @@ int git_reference__update(git_repository *repo, const git_oid *oid, const char * * a new reference and that's it */ if (res == GIT_ENOTFOUND) { giterr_clear(); - return git_reference_create_oid(NULL, repo, ref_name, oid, 1); + return git_reference_create(NULL, repo, ref_name, oid, 1); } if (res < 0) @@ -1810,7 +1810,7 @@ int git_reference__update(git_repository *repo, const git_oid *oid, const char * const char *sym_target; /* The target pointed at by this reference */ - sym_target = git_reference_target(ref); + sym_target = git_reference_symbolic_target(ref); /* resolve the reference to the target it points to */ res = git_reference_resolve(&aux, ref); @@ -1822,7 +1822,7 @@ int git_reference__update(git_repository *repo, const git_oid *oid, const char * */ if (res == GIT_ENOTFOUND) { giterr_clear(); - res = git_reference_create_oid(NULL, repo, sym_target, oid, 1); + res = git_reference_create(NULL, repo, sym_target, oid, 1); git_reference_free(ref); return res; } @@ -1840,7 +1840,7 @@ int git_reference__update(git_repository *repo, const git_oid *oid, const char * /* ref is made to point to `oid`: ref is either the original reference, * or the target of the symbolic reference we've looked up */ - res = git_reference_set_oid(ref, oid); + res = git_reference_set_target(ref, oid); git_reference_free(ref); return res; } @@ -1923,7 +1923,7 @@ static int reference_target(git_object **object, git_reference *ref) { const git_oid *oid; - oid = git_reference_oid(ref); + oid = git_reference_target(ref); return git_object_lookup(object, git_reference_owner(ref), oid, GIT_OBJ_ANY); } diff --git a/src/remote.c b/src/remote.c index 4a4d160eb..063e5186a 100644 --- a/src/remote.c +++ b/src/remote.c @@ -695,7 +695,7 @@ int git_remote_update_tips(git_remote *remote) head = (git_remote_head *)refs.contents[0]; if (!strcmp(head->name, GIT_HEAD_FILE)) { - if (git_reference_create_oid(&ref, remote->repo, GIT_FETCH_HEAD_FILE, &head->oid, 1) < 0) + if (git_reference_create(&ref, remote->repo, GIT_FETCH_HEAD_FILE, &head->oid, 1) < 0) goto on_error; i = 1; @@ -735,7 +735,7 @@ int git_remote_update_tips(git_remote *remote) if (git_vector_insert(&update_heads, head) < 0) goto on_error; - error = git_reference_name_to_oid(&old, remote->repo, refname.ptr); + error = git_reference_name_to_id(&old, remote->repo, refname.ptr); if (error < 0 && error != GIT_ENOTFOUND) goto on_error; @@ -746,7 +746,7 @@ int git_remote_update_tips(git_remote *remote) continue; /* In autotag mode, don't overwrite any locally-existing tags */ - error = git_reference_create_oid(&ref, remote->repo, refname.ptr, &head->oid, !autotag); + error = git_reference_create(&ref, remote->repo, refname.ptr, &head->oid, !autotag); if (error < 0 && error != GIT_EEXISTS) goto on_error; diff --git a/src/repository.c b/src/repository.c index deab77192..1642f4570 100644 --- a/src/repository.c +++ b/src/repository.c @@ -1231,7 +1231,7 @@ int git_repository_head_detached(git_repository *repo) return 0; } - exists = git_odb_exists(odb, git_reference_oid(ref)); + exists = git_odb_exists(odb, git_reference_target(ref)); git_reference_free(ref); return exists; @@ -1250,7 +1250,7 @@ int git_repository_head(git_reference **head_out, git_repository *repo) return 0; } - error = git_reference_lookup_resolved(head_out, repo, git_reference_target(head), -1); + error = git_reference_lookup_resolved(head_out, repo, git_reference_symbolic_target(head), -1); git_reference_free(head); return error == GIT_ENOTFOUND ? GIT_EORPHANEDHEAD : error; @@ -1305,7 +1305,7 @@ int git_repository_is_empty(git_repository *repo) goto cleanup; if (!(error = strcmp( - git_reference_target(head), + git_reference_symbolic_target(head), GIT_REFS_HEADS_DIR "master") == 0)) goto cleanup; @@ -1531,11 +1531,11 @@ int git_repository_set_head( if (!error) { if (git_reference_is_branch(ref)) - error = git_reference_create_symbolic(&new_head, repo, GIT_HEAD_FILE, git_reference_name(ref), 1); + error = git_reference_symbolic_create(&new_head, repo, GIT_HEAD_FILE, git_reference_name(ref), 1); else - error = git_repository_set_head_detached(repo, git_reference_oid(ref)); + error = git_repository_set_head_detached(repo, git_reference_target(ref)); } else if (looks_like_a_branch(refname)) - error = git_reference_create_symbolic(&new_head, repo, GIT_HEAD_FILE, refname, 1); + error = git_reference_symbolic_create(&new_head, repo, GIT_HEAD_FILE, refname, 1); git_reference_free(ref); git_reference_free(new_head); @@ -1559,7 +1559,7 @@ int git_repository_set_head_detached( if ((error = git_object_peel(&peeled, object, GIT_OBJ_COMMIT)) < 0) goto cleanup; - error = git_reference_create_oid(&new_head, repo, GIT_HEAD_FILE, git_object_id(peeled), 1); + error = git_reference_create(&new_head, repo, GIT_HEAD_FILE, git_object_id(peeled), 1); cleanup: git_object_free(object); @@ -1581,10 +1581,10 @@ int git_repository_detach_head( if ((error = git_repository_head(&old_head, repo)) < 0) return error; - if ((error = git_object_lookup(&object, repo, git_reference_oid(old_head), GIT_OBJ_COMMIT)) < 0) + if ((error = git_object_lookup(&object, repo, git_reference_target(old_head), GIT_OBJ_COMMIT)) < 0) goto cleanup; - error = git_reference_create_oid(&new_head, repo, GIT_HEAD_FILE, git_reference_oid(old_head), 1); + error = git_reference_create(&new_head, repo, GIT_HEAD_FILE, git_reference_target(old_head), 1); cleanup: git_object_free(object); diff --git a/src/reset.c b/src/reset.c index 8f470b26a..928a2bc8c 100644 --- a/src/reset.c +++ b/src/reset.c @@ -41,14 +41,14 @@ static int update_head(git_repository *repo, git_object *commit) if ((error = git_reference_lookup(&head, repo, GIT_HEAD_FILE)) < 0) goto cleanup; - if ((error = git_reference_create_oid( + if ((error = git_reference_create( &target, repo, - git_reference_target(head), + git_reference_symbolic_target(head), git_object_id(commit), 0)) < 0) goto cleanup; } else { - if ((error = git_reference_set_oid(head, git_object_id(commit))) < 0) + if ((error = git_reference_set_target(head, git_object_id(commit))) < 0) goto cleanup; } diff --git a/src/revparse.c b/src/revparse.c index 6b49402c4..79900c4cc 100644 --- a/src/revparse.c +++ b/src/revparse.c @@ -140,7 +140,7 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const error = disambiguate_refname(&ref, repo, spec); if (!error) { - error = git_object_lookup(out, repo, git_reference_oid(ref), GIT_OBJ_ANY); + error = git_object_lookup(out, repo, git_reference_target(ref), GIT_OBJ_ANY); git_reference_free(ref); return error; } @@ -203,7 +203,7 @@ static int retrieve_previously_checked_out_branch_or_revision(git_object **out, for (i = 0; i < numentries; i++) { entry = git_reflog_entry_byindex(reflog, i); - msg = git_reflog_entry_msg(entry); + msg = git_reflog_entry_message(entry); if (regexec(&preg, msg, 2, regexmatches, 0)) continue; @@ -263,7 +263,7 @@ static int retrieve_oid_from_reflog(git_oid *oid, git_reference *ref, unsigned i } entry = git_reflog_entry_byindex(reflog, identifier); - git_oid_cpy(oid, git_reflog_entry_oidnew(entry)); + git_oid_cpy(oid, git_reflog_entry_id_new(entry)); error = 0; goto cleanup; @@ -278,7 +278,7 @@ static int retrieve_oid_from_reflog(git_oid *oid, git_reference *ref, unsigned i if (commit_time.time - identifier > 0) continue; - git_oid_cpy(oid, git_reflog_entry_oidnew(entry)); + git_oid_cpy(oid, git_reflog_entry_id_new(entry)); error = 0; goto cleanup; } @@ -306,7 +306,7 @@ static int retrieve_revobject_from_reflog(git_object **out, git_reference **base } if (position == 0) { - error = git_object_lookup(out, repo, git_reference_oid(ref), GIT_OBJ_ANY); + error = git_object_lookup(out, repo, git_reference_target(ref), GIT_OBJ_ANY); goto cleanup; } @@ -632,7 +632,7 @@ static int object_from_reference(git_object **object, git_reference *reference) if (git_reference_resolve(&resolved, reference) < 0) return -1; - error = git_object_lookup(object, reference->owner, git_reference_oid(resolved), GIT_OBJ_ANY); + error = git_object_lookup(object, reference->owner, git_reference_target(resolved), GIT_OBJ_ANY); git_reference_free(resolved); return error; diff --git a/src/revwalk.c b/src/revwalk.c index 4fff238ca..236c94502 100644 --- a/src/revwalk.c +++ b/src/revwalk.c @@ -559,7 +559,7 @@ static int push_ref(git_revwalk *walk, const char *refname, int hide) { git_oid oid; - if (git_reference_name_to_oid(&oid, walk->repo, refname) < 0) + if (git_reference_name_to_id(&oid, walk->repo, refname) < 0) return -1; return push_commit(walk, &oid, hide); diff --git a/src/stash.c b/src/stash.c index b74429aca..89e5ff330 100644 --- a/src/stash.c +++ b/src/stash.c @@ -98,7 +98,7 @@ static int retrieve_base_commit_and_message( "%s: ", git_reference_name(head) + strlen(GIT_REFS_HEADS_DIR)); - if (git_commit_lookup(b_commit, repo, git_reference_oid(head)) < 0) + if (git_commit_lookup(b_commit, repo, git_reference_target(head)) < 0) goto cleanup; if (append_commit_description(stash_message, *b_commit) < 0) @@ -436,7 +436,7 @@ static int update_reflog( git_reflog *reflog = NULL; int error; - if ((error = git_reference_create_oid(&stash, repo, GIT_REFS_STASH_FILE, w_commit_oid, 1)) < 0) + if ((error = git_reference_create(&stash, repo, GIT_REFS_STASH_FILE, w_commit_oid, 1)) < 0) goto cleanup; if ((error = git_reflog_read(&reflog, stash)) < 0) @@ -603,8 +603,8 @@ int git_stash_foreach( entry = git_reflog_entry_byindex(reflog, i); if (callback(i, - git_reflog_entry_msg(entry), - git_reflog_entry_oidnew(entry), + git_reflog_entry_message(entry), + git_reflog_entry_id_new(entry), payload)) { error = GIT_EUSER; goto cleanup; diff --git a/src/submodule.c b/src/submodule.c index 6eb1c52f7..6093ff960 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -695,7 +695,7 @@ int git_submodule_open( /* if we have opened the submodule successfully, let's grab the HEAD OID */ if (!error && !(submodule->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID)) { - if (!git_reference_name_to_oid( + if (!git_reference_name_to_id( &submodule->wd_oid, *subrepo, GIT_HEAD_FILE)) submodule->flags |= GIT_SUBMODULE_STATUS__WD_OID_VALID; else @@ -1316,7 +1316,7 @@ static int lookup_head_remote(git_buf *url, git_repository *repo) /* remote should refer to something like refs/remotes/ORIGIN/BRANCH */ if (git_reference_type(remote) != GIT_REF_SYMBOLIC || - git__prefixcmp(git_reference_target(remote), GIT_REFS_REMOTES_DIR) != 0) + git__prefixcmp(git_reference_symbolic_target(remote), GIT_REFS_REMOTES_DIR) != 0) { giterr_set(GITERR_SUBMODULE, "Cannot resolve relative URL when HEAD is not symbolic"); @@ -1324,7 +1324,7 @@ static int lookup_head_remote(git_buf *url, git_repository *repo) goto cleanup; } - scan = tgt = git_reference_target(remote) + strlen(GIT_REFS_REMOTES_DIR); + scan = tgt = git_reference_symbolic_target(remote) + strlen(GIT_REFS_REMOTES_DIR); while (*scan && (*scan != '/' || (scan > tgt && scan[-1] != '\\'))) scan++; /* find non-escaped slash to end ORIGIN name */ @@ -188,7 +188,7 @@ static int retrieve_tag_reference_oid( if (git_buf_joinpath(ref_name_out, GIT_REFS_TAGS_DIR, tag_name) < 0) return -1; - return git_reference_name_to_oid(oid, repo, ref_name_out->ptr); + return git_reference_name_to_id(oid, repo, ref_name_out->ptr); } static int write_tag_annotation( @@ -267,7 +267,7 @@ static int git_tag_create__internal( } else git_oid_cpy(oid, git_object_id(target)); - error = git_reference_create_oid(&new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite); + error = git_reference_create(&new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite); git_reference_free(new_ref); git_buf_free(&ref_name); @@ -358,7 +358,7 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu return -1; } - error = git_reference_create_oid(&new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite); + error = git_reference_create(&new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite); git_reference_free(new_ref); git_buf_free(&ref_name); @@ -409,7 +409,7 @@ static int tags_cb(const char *ref, void *data) if (git__prefixcmp(ref, GIT_REFS_TAGS_DIR) != 0) return 0; /* no tag */ - if (git_reference_name_to_oid(&oid, d->repo, ref) < 0) + if (git_reference_name_to_id(&oid, d->repo, ref) < 0) return -1; return d->cb(ref, &oid, d->cb_data); diff --git a/src/transports/local.c b/src/transports/local.c index 46c9218c7..caac46ea2 100644 --- a/src/transports/local.c +++ b/src/transports/local.c @@ -48,7 +48,7 @@ static int add_ref(transport_local *t, const char *name) head->name = git__strdup(name); GITERR_CHECK_ALLOC(head->name); - if (git_reference_name_to_oid(&head->oid, t->repo, name) < 0) { + if (git_reference_name_to_id(&head->oid, t->repo, name) < 0) { git__free(head->name); git__free(head); return -1; diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c index e24eb2783..06424cb17 100644 --- a/src/transports/smart_protocol.c +++ b/src/transports/smart_protocol.c @@ -188,7 +188,7 @@ static int fetch_setup_walk(git_revwalk **out, git_repository *repo) if (git_reference_type(ref) == GIT_REF_SYMBOLIC) continue; - if (git_revwalk_push(walk, git_reference_oid(ref)) < 0) + if (git_revwalk_push(walk, git_reference_target(ref)) < 0) goto on_error; git_reference_free(ref); |