#!/bin/bash

set -ex

git ls-files | while read file; do touch -d $(git log -1 --format="@%ct" "$file") "$file"; done

git ls-tree -rt HEAD:./ | awk '{if ($2 == "tree") print $4;}' | tac | while read file; do touch -d $(git log -1 --format="@%ct" "$file") "$file"; done
