diff options
author | Michal Koutný <mkoutny@suse.com> | 2023-03-01 22:54:06 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2023-03-02 15:04:40 +0000 |
commit | edd84b8e4b9db4dc57345ff97dfc7c22d8a6f241 (patch) | |
tree | 24c68bb480ba45f3a5d53153a07a4f5a3897ae41 /meson.build | |
parent | 7a67afe33192ce4a55e6825b80554fb4ebbb4b03 (diff) | |
download | systemd-edd84b8e4b9db4dc57345ff97dfc7c22d8a6f241.tar.gz |
meson: Copy files with git only in true git repository
When mkosi is run from git-worktree(1), the .git is not a repository
directory but a textfile pointing to the real git dir
(e.g. /home/user/systemd/.git/worktrees/systemd-worktree). This git dir
is not bind mounted into build environment and it fails with:
> fatal: not a git repository: /home/user/systemd/.git/worktrees/systemd-worktree
> test/meson.build:190:16: ERROR: Command `/usr/bin/env -u GIT_WORK_TREE /usr/bin/git --git-dir=/root/src/.git ls-files ':/test/dmidecode-dumps/*.bin'` failed with status 128.
There is already a fallback to use shell globbing instead of ls-files,
use it with git worktrees as well.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 0476d972d0..2576153536 100644 --- a/meson.build +++ b/meson.build @@ -815,7 +815,7 @@ endif time_epoch = get_option('time-epoch') if time_epoch <= 0 time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"', check : true).stdout().strip() - if time_epoch == '' and git.found() and fs.exists('.git') + if time_epoch == '' and git.found() and fs.is_dir('.git') # If we're in a git repository, use the creation time of the latest git tag. latest_tag = run_command(git, 'describe', '--abbrev=0', '--tags', check : false) |