Examples: fix reference names

This commit is contained in:
Ben Straub 2012-11-18 22:20:26 -07:00
parent cfbe4be3fb
commit bac695b58c
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -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");