Skip to content

Commit

Permalink
create-test-repo: sleep between commits
Browse files Browse the repository at this point in the history
Sleep after creating each test commit, so that the commits all have
distinct timestamps.
  • Loading branch information
mhagger committed Oct 18, 2018
1 parent eb8991c commit 13b70e6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions t/create-test-repo
Expand Up @@ -4,6 +4,9 @@ set -e

DESCRIPTION="git-imerge test repository"

# Sleep between commits to give commits distinct timestamps:
SLEEP="sleep 1"

modify() {
filename="$1"
text="$2"
Expand Down Expand Up @@ -36,47 +39,55 @@ git config user.email 'luser@example.com'

modify a.txt 0
git commit -m 'm⇒0'
$SLEEP

git checkout -b a --
for i in $(seq 8)
do
modify a.txt $i
git commit -m "a⇒$i"
$SLEEP
done

git checkout -b b master --
for i in $(seq 5)
do
modify b.txt $i
git commit -m "b⇒$i"
$SLEEP
done

git checkout -b c master --
for i in $(seq 3)
do
modify c.txt $i
git commit -m "c⇒$i"
$SLEEP
done
modify conflict.txt "c version"
git commit -m "c conflict"
$SLEEP
for i in $(seq 4 8)
do
modify c.txt $i
git commit -m "c⇒$i"
$SLEEP
done

git checkout -b d master --
for i in $(seq 2)
do
modify d.txt $i
git commit -m "d⇒$i"
$SLEEP
done
modify conflict.txt "d version"
git commit -m "d conflict"
for i in $(seq 3 5)
do
modify d.txt $i
git commit -m "d⇒$i"
$SLEEP
done

git checkout master --
Expand Down

0 comments on commit 13b70e6

Please sign in to comment.