From 04e0835f29b6d21e8491ba6f35092f1ab860263d Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sun, 18 Feb 2024 10:00:47 -0500 Subject: Extract git repository information * First pass; this will eventually be used to rewite exact commit refs in YAML delivery files --- src/deliverable.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/deliverable.c') diff --git a/src/deliverable.c b/src/deliverable.c index 9b5d94d..e1179a4 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -1302,7 +1302,12 @@ void delivery_tests_run(struct Delivery *ctx) { } } msg(OMC_MSG_L3, "Cloning repository %s\n", ctx->tests[i].repository); - git_clone(&proc, ctx->tests[i].repository, destdir, ctx->tests[i].version); + if (!git_clone(&proc, ctx->tests[i].repository, destdir, ctx->tests[i].version)) { + ctx->tests[i].repository_info_tag = strdup(git_describe(destdir)); + ctx->tests[i].repository_info_ref = strdup(git_rev_parse(destdir, "HEAD")); + } else { + COE_CHECK_ABORT(!globals.continue_on_error, "Unable to clone repository\n") + } if (pushd(destdir)) { COE_CHECK_ABORT(!globals.continue_on_error, "Unable to enter repository directory\n") -- cgit