hooks/post-merge: Ensure correct directory for git

Commands for updating timestamps of source files based on `git commit`
times need to run in the correct directory for the git repository in
question; this isn't always the same as the initially cloned repository.
This commit is contained in:
Alex Palaistras 2021-09-22 21:32:10 +01:00
parent 9a0e6ba521
commit 821c5e4625

View File

@ -43,7 +43,7 @@ function sync-coreos-config() {
continue
fi
touch -t "$(git -C "$TEMP_CONFIG_PATH" log -n 1 --pretty=format:%cd --date=format:%Y%m%d%H%M.%S --date-order -- "$f")" -- "$f"
touch -t "$(cd "$dir" && git log -n 1 --pretty=format:%cd --date=format:%Y%m%d%H%M.%S --date-order -- "$f")" -- "$f"
done
# Copy files from temporary directory to host configuration directory.