From 821c5e4625504465e9dc164981dbd505bb78316c Mon Sep 17 00:00:00 2001 From: Alex Palaistras Date: Wed, 22 Sep 2021 21:32:10 +0100 Subject: [PATCH] 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. --- hooks/post-merge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/post-merge b/hooks/post-merge index 4364d2a..5f6b1ce 100755 --- a/hooks/post-merge +++ b/hooks/post-merge @@ -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.