chiark / gitweb /
Test suite: tartree-edit: gitfetchinfo: Specify commit timestamps
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 Jul 2016 10:24:28 +0000 (11:24 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 Jul 2016 10:24:28 +0000 (11:24 +0100)
We want the commit timestamps to be predictable (ie, to depend on the
source info only), so that we don't show spurious disagreement between
two working trees.  So, use the timestamp of the HEAD commit.

tests/tartree-edit

index 76e51b67169d7b84e84eb6edda573860f7f3d9b0..1aeab3d41dc7f8e2b58051667e0dc37c114141de 100755 (executable)
@@ -129,6 +129,9 @@ tryat_gitfetchinfo () {
        git fetch --no-tags -p "$remote" \
                +"HEAD:refs/remotes/$remote/HEAD"
        cd $innerwd
+       GIT_AUTHOR_DATE=$(git log -n1 --pretty=format:'%ai')
+       GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE
+       export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
        git checkout -b WORKTREE
        gitfetchinfo_perhaps_commit INDEX
        git add -Af .