Skip to content

Commit

Permalink
Fix ownership of local git repo used during tests
Browse files Browse the repository at this point in the history
Using the --shared feature of init
  • Loading branch information
mosteo committed Jun 21, 2024
1 parent 331b10e commit f17ca26
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

Expand Down
13 changes: 10 additions & 3 deletions scripts/ci-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ pushd "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. ../dev/functions.sh
popd

# Mark location safe to assuage git if necessary (happens in some distros)
# Mark location safe to assuage git if necessary (happens under docker as we
# run with a different user).
if git status 2>&1 | grep -q "dubious ownership"; then
echo "Marking $PWD as safe for git"
git config --global --add safe.directory "$PWD"
echo "Marking $PWD as safe for git"
git config --global --add safe.directory "$PWD"

# Change ownership and group to current user of everything in the testsuite,
# as we have there some pre-created git repositories that would fail too.
# These are copied to temporary locations by the test runner, so we cannot
# simply use the `git config` trick.
sudo chown -R $(id -u):$(id -g) testsuite
fi

# Patch version
Expand Down
2 changes: 1 addition & 1 deletion src/alire/alire-version.ads
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private
-- be replaced by `alr build` with the current commit, and appended with
-- "_or_later" after build.

Current_Str : constant String := "2.1-dev";
Current_Str : constant String := "2.1-dev+367057b7";
-- 2.0.0: alr settings refactor and minor fixes
-- 2.0.0-rc1: release candidate for 2.0
-- 2.0.0-b1: first public release on the 2.0 branch
Expand Down
2 changes: 1 addition & 1 deletion testsuite/fixtures/crates/libfoo_git/HEAD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ref: refs/heads/master
ref: refs/heads/main
3 changes: 3 additions & 0 deletions testsuite/fixtures/crates/libfoo_git/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
repositoryformatversion = 0
filemode = true
bare = true
sharedrepository = 2
[receive]
denyNonFastforwards = true
Binary file not shown.

This file was deleted.

Binary file not shown.
2 changes: 0 additions & 2 deletions testsuite/fixtures/crates/libfoo_git/packed-refs

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion testsuite/fixtures/crates/libhello_git
Submodule libhello_git deleted from ce78e7

0 comments on commit f17ca26

Please sign in to comment.