Commit bac695b5 by Ben Straub

Examples: fix reference names

parent cfbe4be3
......@@ -30,7 +30,7 @@ static int resolve_to_tree(
git_reference_resolve(&resolved, ref);
git_reference_free(ref);
if (resolved) {
git_object_lookup(&obj, repo, git_reference_oid(resolved), GIT_OBJ_ANY);
git_object_lookup(&obj, repo, git_reference_target(resolved), GIT_OBJ_ANY);
git_reference_free(resolved);
}
}
......
......@@ -405,12 +405,12 @@ int main (int argc, char** argv)
switch (git_reference_type(ref)) {
case GIT_REF_OID:
git_oid_fmt(out, git_reference_oid(ref));
git_oid_fmt(out, git_reference_target(ref));
printf("%s [%s]\n", refname, out);
break;
case GIT_REF_SYMBOLIC:
printf("%s => %s\n", refname, git_reference_target(ref));
printf("%s => %s\n", refname, git_reference_symbolic_target(ref));
break;
default:
fprintf(stderr, "Unexpected reference type\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment