about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--local.mk3
-rw-r--r--release.nix4
2 files changed, 5 insertions, 2 deletions
diff --git a/local.mk b/local.mk
index 160057ad2625..2541f3f32290 100644
--- a/local.mk
+++ b/local.mk
@@ -1,5 +1,6 @@
 ifeq ($(MAKECMDGOALS), dist)
-  dist-files += $(shell git ls-files)
+  # Make sure we are in repo root with `--git-dir`
+  dist-files += $(shell git --git-dir=.git ls-files || find * -type f)
 endif
 
 dist-files += configure config.h.in nix.spec
diff --git a/release.nix b/release.nix
index 5a5a1226fe2c..4459bf165a50 100644
--- a/release.nix
+++ b/release.nix
@@ -36,7 +36,9 @@ let
 
         postUnpack = ''
           # Clean up when building from a working tree.
-          (cd $sourceRoot && (git ls-files -o | xargs -r rm -v))
+          if [[ -d $sourceRoot/.git ]]; then
+            git -C $sourceRoot clean -fd
+          fi
         '';
 
         preConfigure = ''