Commit a9fc14b0 by Edward Thomson

oid: avoid `tostr_s` in many places

The `git_oid_tostr_s` helper is indeed helpful, unless you are using
printf debugging (by inserting more `git_oid_tostr_s` calls) shortly
after using it.  Avoid it before invoking complex functions.
parent 74471eef
...@@ -123,7 +123,10 @@ int git_branch_create( ...@@ -123,7 +123,10 @@ int git_branch_create(
const git_commit *commit, const git_commit *commit,
int force) int force)
{ {
return create_branch(ref_out, repository, branch_name, commit, git_oid_tostr_s(git_commit_id(commit)), force); char commit_id[GIT_OID_HEXSZ + 1];
git_oid_tostr(commit_id, GIT_OID_HEXSZ + 1, git_commit_id(commit));
return create_branch(ref_out, repository, branch_name, commit, commit_id, force);
} }
int git_branch_create_from_annotated( int git_branch_create_from_annotated(
......
...@@ -188,7 +188,10 @@ int git_reset( ...@@ -188,7 +188,10 @@ int git_reset(
git_reset_t reset_type, git_reset_t reset_type,
const git_checkout_options *checkout_opts) const git_checkout_options *checkout_opts)
{ {
return reset(repo, target, git_oid_tostr_s(git_object_id(target)), reset_type, checkout_opts); char to[GIT_OID_HEXSZ + 1];
git_oid_tostr(to, GIT_OID_HEXSZ + 1, git_object_id(target));
return reset(repo, target, to, reset_type, checkout_opts);
} }
int git_reset_from_annotated( int git_reset_from_annotated(
......
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