File: setup-test-git-env.sh

package info (click to toggle)
kgb-bot 1.62-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 788 kB
  • sloc: perl: 4,836; sh: 173; makefile: 27
file content (43 lines) | stat: -rwxr-xr-x 905 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh

set -e
set -u

ROOT=$PWD
mkdir $ROOT/git-test

mkdir $ROOT/git-test/repo.git
cd $ROOT/git-test/repo.git
git init --bare

cat <<EOF > $ROOT/git-test/repo.git/hooks/post-receive
#!/bin/sh

tee -a $ROOT/git-test/reflog | PERL5LIB=$ROOT/lib $ROOT/script/kgb-client --repository git --uri http://localhost:9999 --pass "truely secret" --repo-id test --git-reflog -
EOF

chmod 0755 $ROOT/git-test/repo.git/hooks/post-receive

mkdir $ROOT/git-test/work
cd $ROOT/git-test/work
echo "testing" > a
git init
git add a
git commit -m "initial import"
git remote add origin file://$ROOT/git-test/repo.git
git config --add branch.master.remote origin
git config --add branch.master.merge refs/heads/master

git push

echo "more testing" > b
echo "twisted testing" > a
git add .
git commit -m 'some modifications'

echo "third file" > c
git add .
git commit -m 'short note

followed by a longer thing'
git push