Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'convert.c')
-rw-r--r--convert.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/convert.c b/convert.c
index 6261921cfb..5aa87d45e3 100644
--- a/convert.c
+++ b/convert.c
@@ -2006,3 +2006,25 @@ int stream_filter(struct stream_filter *filter,
{
return filter->vtbl->filter(filter, input, isize_p, output, osize_p);
}
+
+void init_checkout_metadata(struct checkout_metadata *meta, const char *refname,
+ const struct object_id *treeish,
+ const struct object_id *blob)
+{
+ memset(meta, 0, sizeof(*meta));
+ if (refname)
+ meta->refname = refname;
+ if (treeish)
+ oidcpy(&meta->treeish, treeish);
+ if (blob)
+ oidcpy(&meta->blob, blob);
+}
+
+void clone_checkout_metadata(struct checkout_metadata *dst,
+ const struct checkout_metadata *src,
+ const struct object_id *blob)
+{
+ memcpy(dst, src, sizeof(*dst));
+ if (blob)
+ oidcpy(&dst->blob, blob);
+}