-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_grit
executable file
·43 lines (35 loc) · 1.02 KB
/
test_grit
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/bash
api_host=localhost:9000/v1
echo Create a new repo
curl -X POST -d "path=test&repo_name=test_repo&bare=false" $api_host/repos/
echo
echo Show a repo.
curl -X GET -d "path=test&repo_name=test_repo" $api_host/repos/
echo
cd ~/gitcafe/test/test_repo
touch readme >> null
git add . >> null
git commit -m 'add readme' >> null
git br feature >> null
commit=$(git show | grep commit) >> null
id=${commit#commit} >> null
echo Show all branches.
curl -X GET -d "path=test&repo_name=test_repo" $api_host/repos/branches
echo
echo List commits
curl -X GET -d "path=test&repo_name=test_repo&branch=master" $api_host/commits
echo
echo Show commit info
curl $api_host/commits/test/test_repo?id=$(echo $id)
echo
echo The commit
curl -v $api_host/commits/test/test_repo/$(echo $id)/diff
echo
echo Fork a repo
curl -X POST -d "fork_path=fork" $api_host/repos/test/test_repo/fork_bare
echo
echo Delete a repo
curl -X DELETE -d "path=test&repo_name=test_repo" $api_host/repos/
echo
echo 清理工作
rm -rf ~/gitcafe/fork/test_repo.git