Test for generated patchname with trailing period
[stgit.git] / t / t4000 / make-repo.sh
blob516990e1578605b90ce64c8b0f149a9355b75138
1 # This script makes several versions of a small test repository that
2 # can be used for testing the format version upgrade code.
4 LANG=C
5 LC_ALL=C
6 PAGER=cat
7 TZ=UTC
8 export LANG LC_ALL PAGER TZ
9 unset AUTHOR_DATE
10 unset AUTHOR_EMAIL
11 unset AUTHOR_NAME
12 unset COMMIT_AUTHOR_EMAIL
13 unset COMMIT_AUTHOR_NAME
14 unset GIT_ALTERNATE_OBJECT_DIRECTORIES
15 unset GIT_AUTHOR_DATE
16 GIT_AUTHOR_EMAIL=author@example.com
17 GIT_AUTHOR_NAME='A U Thor'
18 unset GIT_COMMITTER_DATE
19 GIT_COMMITTER_EMAIL=committer@example.com
20 GIT_COMMITTER_NAME='C O Mitter'
21 unset GIT_DIFF_OPTS
22 unset GIT_DIR
23 unset GIT_EXTERNAL_DIFF
24 unset GIT_INDEX_FILE
25 unset GIT_OBJECT_DIRECTORY
26 unset SHA1_FILE_DIRECTORIES
27 unset SHA1_FILE_DIRECTORY
28 export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
29 export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
31 set -e
33 for ver in 1.1 1.0 0.19 0.12 0.8; do
34 if [ -e $ver.tar.gz ]; then continue; fi
36 # Get the required stgit version.
38 cd ../..
39 git archive --format=tar --prefix=stgit-$ver/ v$ver
40 ) | tar xf -
42 # Set up a repository.
43 mkdir $ver
44 cd $ver || exit 1
45 git init
46 touch foo
47 git add foo
48 git commit -m 'Initial commit'
50 # Use the old stgit.
52 pwd
53 PATH=../stgit-$ver:$PATH
55 stg --version
56 stg init
57 stg branch --description='cool branch' || \
58 echo 'cool branch' > .git/patches/master/description
60 for i in 0 1 2 3 4; do
61 stg new p$i -m "Patch $i"
62 echo "Line $i" >> foo
63 stg refresh
64 done
65 stg pop -n 2
66 stg branch --protect || \
67 echo "'stg branch --protect' not available"
70 # Reduce the number of small files.
71 git gc
73 # Make a tarball.
74 cd ..
75 tar zcf $ver.tar.gz $ver
76 done