tests/copy-src: always copy .git dir

This is required by a later commit that introduces flakes-based test
evaluation. Evaluating local flakes needs a repo dir.
This commit is contained in:
Erik Arvstedt 2022-10-22 19:37:50 +02:00 committed by Greg Shuflin
parent f405a2ceda
commit e2d653e7cb
3 changed files with 1 additions and 21 deletions

View File

@ -14,7 +14,7 @@ atExit() {
trap "atExit" EXIT
# shellcheck disable=SC2154
rsync -a --delete --exclude='.git*' "$scriptDir/../" "$tmp/src"
rsync -a --delete "$scriptDir/../" "$tmp/src"
echo "Copied src"
# shellcheck disable=SC2154

View File

@ -1,15 +0,0 @@
# Create and maintain a minimal git repo at the root of the copied src
(
# shellcheck disable=SC2154,SC2164
cd "$scriptDir/.."
amend=(--amend)
if [[ ! -e .git ]] || ! git rev-parse HEAD 2>/dev/null; then
git init
amend=()
fi
git add .
if ! git diff --quiet --cached; then
git commit -a "${amend[@]}" -m -
fi
) >/dev/null

View File

@ -277,11 +277,6 @@ flake() {
nixosSearch() {
if ! checkFlakeSupport "nixosSearch"; then return; fi
if [[ $_nixBitcoinInCopiedSrc ]]; then
# flake-info requires that its target flake is under version control
. "$scriptDir/lib/create-git-repo.sh"
fi
if [[ $outLinkPrefix ]]; then
# Add gcroots for flake-info
nix build "$scriptDir/nixos-search#flake-info" -o "$outLinkPrefix-flake-info"