diff options
| -rw-r--r-- | mesonbuild/mdist.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py index b1d8f6780..0c82cd3ef 100644 --- a/mesonbuild/mdist.py +++ b/mesonbuild/mdist.py @@ -141,7 +141,9 @@ 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']) + # Optimistically call update-index, and disregard its return value. It could be read-only, + # and only the output of diff-index matters. + subprocess.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 |
