summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/mdist.py1
-rw-r--r--unittests/allplatformstests.py5
2 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py
index 1ae0f5916..e4606306b 100644
--- a/mesonbuild/mdist.py
+++ b/mesonbuild/mdist.py
@@ -140,6 +140,7 @@ class GitDist(Dist):
def have_dirty_index(self) -> bool:
'''Check whether there are uncommitted changes in git'''
+ subprocess.check_call(['git', '-C', self.src_root, 'update-index', '-q', '--refresh'])
ret = subprocess.call(['git', '-C', self.src_root, 'diff-index', '--quiet', 'HEAD'])
return ret == 1
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 86ffa92f9..9c9f61678 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -1494,7 +1494,8 @@ class AllPlatformTests(BasePlatformTests):
subproject('tarballsub', required : false)
subproject('samerepo', required : false)
'''))
- with open(os.path.join(project_dir, 'distexe.c'), 'w', encoding='utf-8') as ofile:
+ distexe_c = os.path.join(project_dir, 'distexe.c')
+ with open(distexe_c, 'w', encoding='utf-8') as ofile:
ofile.write(textwrap.dedent('''\
#include<stdio.h>
@@ -1528,6 +1529,8 @@ class AllPlatformTests(BasePlatformTests):
self.assertPathDoesNotExist(gz_checksumfile)
self.assertPathDoesNotExist(zip_distfile)
self.assertPathDoesNotExist(zip_checksumfile)
+ # update a source file timestamp; dist should succeed anyway
+ os.utime(distexe_c)
self._run(self.meson_command + ['dist', '--formats', 'bztar'],
workdir=self.builddir)
self.assertPathExists(bz_distfile)