From f1ea69474dd4fadf906dec95d828d74fe5efaecc Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 10 Jun 2022 16:12:02 +0100 Subject: [PATCH] scripts: Mark git repository as safe Git will refuse to generate information for the report if the repository is owned by a different user (root in the container vs the real owner outside). e.g: Error generating human readable git reference: fatal: unsafe repository ('/cloud-hypervisor' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /cloud-hypervisor Signed-off-by: Rob Bradford --- scripts/run_metrics.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/run_metrics.sh b/scripts/run_metrics.sh index 6f693731c..7ca195c92 100755 --- a/scripts/run_metrics.sh +++ b/scripts/run_metrics.sh @@ -113,6 +113,9 @@ if [ -n "$test_filter" ]; then test_binary_args+=("--test-filter $test_filter") fi +# Ensure that git commands can be run in this directory (for metrics report) +git config --global --add safe.directory $PWD + export RUST_BACKTRACE=1 time target/$BUILD_TARGET/release/performance-metrics ${test_binary_args[*]} RES=$?