forked from lennart/git-achievements
/
testscript
executable file
·86 lines (64 loc) · 1.76 KB
/
testscript
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash -x
#
# This is a test script for git achievements
#
function runtest() {
# setup our push repo
mkdir testapplication.push
cd testapplication.push
git init
cd ../
mkdir testapplication
cd testapplication
git achievements --help
git init
touch README
git add README
git commit -s -m "First commit"
git diff --cached
echo "hello world" > README
git add README
git diff --cached
git commit -s -m "Second commit"
touch second_file
git blame second_file
touch .gitignore
echo "second_file" >> .gitignore
git add .gitignore
git commit -s -m "third commit"
git commit --amend -m "Third commit"
git commit --amend -m "Third awesome commit"
git remote add origin ../testapplication.push/.git/
git remote add local ../testapplication.push/.git/
git push origin
git log
git log -Sworld
git checkout -b testbranch master
git checkout -b otherbranch master
git push origin --all
git gc
git gc
git blame README
git reflog
mv .git/hooks/pre-commit.sample .git/hooks/pre-commit
git format-patch HEAD^
git reset --hard HEAD^
git am -k3 0001*
git config alias.xxx ls-files
git xxx
git config --unset alias.xxx
}
export PATH=$PATH:$PWD/../
# can't use an alias in a shell script because it is evaluated at read time
function git() {
git-achievements "$@"
}
# cleanup
mv -f ~/.git-achievements.log ~/.git-achievements.bak
mv -f ~/.git-achievements-action.log ~/.git-achievements-action.bak
rm -rf testapplication
rm -rf testapplication.push
runtest
git achievements -a
mv -f ~/.git-achievements.bak ~/.git-achievements.log
mv -f ~/.git-achievements-action.bak ~/.git-achievements-action.log