aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-19 13:47:19 -0700
committerJunio C Hamano <gitster@pobox.com>2016-09-19 13:47:19 -0700
commit4af9a7d344b0e1c3b504c0cfb650dabdb1df1852 (patch)
tree243319fc09235a1e046ea94f40f7837ed9f02ea2 /refs.c
parent4322f3848a224843a2df81055f07899ce1a1b388 (diff)
parent3a5d7c55f76681ad9dcef8564275217881c9ace0 (diff)
downloadgit-4af9a7d344b0e1c3b504c0cfb650dabdb1df1852.tar.gz
git-4af9a7d344b0e1c3b504c0cfb650dabdb1df1852.tar.xz
Merge branch 'bc/object-id'
The "unsigned char sha1[20]" to "struct object_id" conversion continues. Notable changes in this round includes that ce->sha1, i.e. the object name recorded in the cache_entry, turns into an object_id. It had merge conflicts with a few topics in flight (Christian's "apply.c split", Dscho's "cat-file --filters" and Jeff Hostetler's "status --porcelain-v2"). Extra sets of eyes double-checking for mismerges are highly appreciated. * bc/object-id: builtin/reset: convert to use struct object_id builtin/commit-tree: convert to struct object_id builtin/am: convert to struct object_id refs: add an update_ref_oid function. sha1_name: convert get_sha1_mb to struct object_id builtin/update-index: convert file to struct object_id notes: convert init_notes to use struct object_id builtin/rm: convert to use struct object_id builtin/blame: convert file to use struct object_id Convert read_mmblob to take struct object_id. notes-merge: convert struct notes_merge_pair to struct object_id builtin/checkout: convert some static functions to struct object_id streaming: make stream_blob_to_fd take struct object_id builtin: convert textconv_object to use struct object_id builtin/cat-file: convert some static functions to struct object_id builtin/cat-file: convert struct expand_data to use struct object_id builtin/log: convert some static functions to use struct object_id builtin/blame: convert struct origin to use struct object_id builtin/apply: convert static functions to struct object_id cache: convert struct cache_entry to use struct object_id
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index 113e3c83b..5ffdd778d 100644
--- a/refs.c
+++ b/refs.c
@@ -877,6 +877,14 @@ int ref_transaction_verify(struct ref_transaction *transaction,
flags, NULL, err);
}
+int update_ref_oid(const char *msg, const char *refname,
+ const struct object_id *new_oid, const struct object_id *old_oid,
+ unsigned int flags, enum action_on_err onerr)
+{
+ return update_ref(msg, refname, new_oid ? new_oid->hash : NULL,
+ old_oid ? old_oid->hash : NULL, flags, onerr);
+}
+
int update_ref(const char *msg, const char *refname,
const unsigned char *new_sha1, const unsigned char *old_sha1,
unsigned int flags, enum action_on_err onerr)