Skip to content

DIAG v6: pre-drop replication with submodules: recursive on actions/c… #2621

DIAG v6: pre-drop replication with submodules: recursive on actions/c…

DIAG v6: pre-drop replication with submodules: recursive on actions/c… #2621

Workflow file for this run

name: test-cygwin
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
diag-recursive:
runs-on: windows-latest
env:
CHERE_INVOKING: "1"
CYGWIN_NOWINPATH: "1"
defaults:
run:
shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr "{0}"
steps:
- name: Force LF line endings
run: |
git config --global core.autocrlf false
shell: pwsh
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive # KEY DIFFERENCE: actions/checkout does the recursive clone (pre-drop scenario)
- name: Install Cygwin
uses: cygwin/cygwin-install-action@v6
with:
packages: git
add-to-path: false
- name: PRE-Cygwin-update — what does actions/checkout's recursive clone produce?
shell: pwsh
run: |
$repo = "D:\a\GitPython\GitPython"
$paths = @(
"$repo\git\ext\gitdb",
"$repo\git\ext\gitdb\.git",
"$repo\.git\modules\gitdb",
"$repo\git\ext\gitdb\gitdb",
"$repo\git\ext\gitdb\gitdb\ext",
"$repo\git\ext\gitdb\gitdb\ext\smmap",
"$repo\git\ext\gitdb\gitdb\ext\smmap\.git",
"$repo\.git\modules\gitdb\modules",
"$repo\.git\modules\gitdb\modules\smmap"
)
Write-Host "==================== POST-CHECKOUT (with submodules: recursive), PRE-CYGWIN ===================="
foreach ($p in $paths) {
Write-Host "==== $p"
if (Test-Path -LiteralPath $p) {
$item = Get-Item -LiteralPath $p -Force
$acl = Get-Acl -LiteralPath $p
Write-Host " Type: $(if ($item.PSIsContainer) {'Directory'} else {'File'})"
Write-Host " Owner: $($acl.Owner)"
if ($item.PSIsContainer) {
$count = (Get-ChildItem -LiteralPath $p -Force).Count
Write-Host " Total entries: $count"
}
} else {
Write-Host " (does not exist)"
}
Write-Host ""
}
- name: Cygwin-side stat (PRE-Cygwin-update)
run: |
set +e
echo "==================================================================="
echo "Cygwin uid: $(id -u) ($(id -un))"
echo "==================================================================="
for path in \
"$(pwd)/git/ext/gitdb" \
"$(pwd)/git/ext/gitdb/.git" \
"$(pwd)/.git/modules/gitdb" \
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
"$(pwd)/.git/modules/gitdb/modules/smmap"; do
if [ -e "$path" ]; then
echo "$(stat -c '%u(%U) %F mode=%a' "$path") $path"
else
echo "(does not exist) $path"
fi
done
- name: Run init-tests-after-clone.sh (the actual chain script)
run: |
git config --global --add safe.directory "$(pwd)"
git config --global --add safe.directory "$(pwd)/.git"
./init-tests-after-clone.sh
- name: POST-init-tests state
shell: pwsh
run: |
$repo = "D:\a\GitPython\GitPython"
$paths = @(
"$repo\git\ext\gitdb",
"$repo\git\ext\gitdb\.git",
"$repo\.git\modules\gitdb",
"$repo\git\ext\gitdb\gitdb\ext\smmap",
"$repo\git\ext\gitdb\gitdb\ext\smmap\.git",
"$repo\.git\modules\gitdb\modules\smmap"
)
Write-Host "==================== POST-INIT-TESTS (Cygwin script ran) ===================="
foreach ($p in $paths) {
Write-Host "==== $p"
if (Test-Path -LiteralPath $p) {
$acl = Get-Acl -LiteralPath $p
Write-Host " Owner: $($acl.Owner)"
} else {
Write-Host " (does not exist)"
}
}
- name: Run trust check on each fixture (post-init-tests, pre-fix safe.directory)
run: |
set +e -x
echo "Effective safe.directory:"
git config --global --get-all safe.directory
echo
for fixture in \
"$(pwd)" \
"$(pwd)/git/ext/gitdb" \
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap"; do
echo "--- git -C $fixture rev-parse --show-toplevel"
git -C "$fixture" rev-parse --show-toplevel 2>&1
echo "(rc=$?)"
echo
done
true