Skip to content
Snippets Groups Projects
Unverified Commit 34222ed9 authored by Oliver Smith's avatar Oliver Smith
Browse files

install_pmbootstrap: mark pmaports as safe dir

In latest git version a safety check was added that makes sure a git
directory is owned by the same user that tries to modify it. Since this
script runs only in CI, we can just mark it as safe directory and it
should work the same as before.

Fix for:
  Creating pmos user
  Found pmaports.cfg in current dir
  ERROR: failed to add original remote with git!
  fatal: unsafe repository ('/builds/anjandev/pmaports' is owned by someone else)
  To add an exception for this directory, call:
    git config --global --add safe.directory /builds/anjandev/pmaports

Related: https://gitlab.com/anjandev/pmaports/-/jobs/2328801751
parent 739e7ddd
No related branches found
No related tags found
No related merge requests found
Pipeline #145202 passed
......@@ -20,6 +20,11 @@ add_remote_origin_original() {
return
fi
# Mark pmaports dir as 'safe directory', so git doesn't complain about
# it being owned by another user.
git config --global --add safe.directory "$pmaports"
su pmos -c "git config --global --add safe.directory '$pmaports'"
# Add the remote, display the output only on error
if ! git -C "$pmaports" \
remote add -f origin-original \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment