From e2d653e7cb7406106a148cd0a444289a24809559 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sat, 22 Oct 2022 19:37:50 +0200 Subject: [PATCH] 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. --- test/lib/copy-src.sh | 2 +- test/lib/create-git-repo.sh | 15 --------------- test/run-tests.sh | 5 ----- 3 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 test/lib/create-git-repo.sh diff --git a/test/lib/copy-src.sh b/test/lib/copy-src.sh index e19134c..b1b720e 100644 --- a/test/lib/copy-src.sh +++ b/test/lib/copy-src.sh @@ -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 diff --git a/test/lib/create-git-repo.sh b/test/lib/create-git-repo.sh deleted file mode 100644 index 6721b4b..0000000 --- a/test/lib/create-git-repo.sh +++ /dev/null @@ -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 diff --git a/test/run-tests.sh b/test/run-tests.sh index 0fa227e..637a032 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -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"