File tree Expand file tree Collapse file tree 5 files changed +130
-1
lines changed Expand file tree Collapse file tree 5 files changed +130
-1
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ compgen: force
110110 $(SHARE ) /zsh-completion/_git-subrepo
111111
112112clean :
113- rm -fr tmp test/tmp
113+ rm -fr tmp test/tmp test/repo
114114
115115define docker-make-test
116116 docker run --rm \
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -xe
3+
4+ if [ -z " ${1} " ]; then
5+ echo " ${BASH_SOURCE[0]} : Single argument required (common test repos path)"
6+ exit 1
7+ fi
8+
9+ REPO=" bar"
10+ NAME=" Bar"
11+ TARGET=" ${1} /$REPO "
12+ TMPREPO=" ${1} /tmp/$REPO "
13+
14+ rm -rf " $TMPREPO "
15+ mkdir -p " $TMPREPO "
16+ cd " $TMPREPO "
17+ git init --initial-branch=master .
18+ git config user.name " ${NAME} User"
19+ git config user.email " ${REPO} @${REPO} "
20+ touch $NAME
21+ git add $NAME
22+ git commit -m" $NAME "
23+ git tag A -m" $NAME "
24+ mkdir -p bard
25+ touch bard/Bard
26+ git add bard
27+ git commit -m" bard/Bard"
28+ git config --bool core.bare true
29+ cd -
30+ mkdir -p " $1 "
31+ mv " $TMPREPO /.git" " $TARGET "
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -xe
3+
4+ if [ -z " ${1} " ]; then
5+ echo " ${BASH_SOURCE[0]} : Single argument required (common test repos path)"
6+ exit 1
7+ fi
8+
9+ REPO=" foo"
10+ NAME=" Foo"
11+ TARGET=" ${1} /$REPO "
12+ TMPREPO=" ${1} /tmp/$REPO "
13+
14+ rm -rf " $TMPREPO "
15+ mkdir -p " $TMPREPO "
16+ cd " $TMPREPO "
17+ git init --initial-branch=master .
18+ git config user.name " ${NAME} User"
19+ git config user.email " ${REPO} @${REPO} "
20+ touch $NAME
21+ git add $NAME
22+ git commit -m" $NAME "
23+ git config --bool core.bare true
24+ cd -
25+ mkdir -p " $1 "
26+ mv " ${TMPREPO} /.git" " $TARGET "
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -xe
3+
4+ if [ -z " ${1} " ]; then
5+ echo " ${BASH_SOURCE[0]} : Single argument required (common test repos path)"
6+ exit 1
7+ fi
8+
9+ REPO=" init"
10+ NAME=" Init"
11+ TARGET=" ${1} /$REPO "
12+ TMPREPO=" ${1} /tmp/$REPO "
13+
14+ rm -rf " $TMPREPO "
15+ mkdir -p " $TMPREPO "
16+ cd " $TMPREPO "
17+ git init --initial-branch=master .
18+ git config user.name " ${NAME} User"
19+ git config user.email " ${REPO} @${REPO} "
20+ cat << EOF > ReadMe
21+ This is a repo to test \` git subrepo init\` .
22+
23+ We will make a short history with a subdir, then we can turn that subdir into a
24+ subrepo.
25+ EOF
26+ git add ReadMe
27+ git commit -m" Initial commit"
28+ mkdir -p doc
29+ cat << EOF > doc/init.swim
30+ == Subrepo Init!
31+
32+ This is a file to test the \` git subrepo init\` command.
33+ EOF
34+ git add doc
35+ git commit -m" Add a file in a subdir."
36+ cat << EOF >> ReadMe
37+
38+ This repo will go in the git-subrepo test suite.
39+ EOF
40+ git add ReadMe
41+ git commit -m" Add a commit to the mainline."
42+ cat << EOF >> doc/init.swim
43+
44+ It lives under the doc directory which will become a subrepo.
45+ EOF
46+ git add doc/init.swim
47+ git commit -m" Add a commit to the subdir."
48+ cat << EOF >> ReadMe
49+
50+ EOF
51+ git add ReadMe
52+ cat << EOF >> doc/init.swim
53+
54+ EOF
55+ git add doc/init.swim
56+ git commit -m" Add a commit that affects both."
57+ git config --bool core.bare true
58+ cd -
59+ mkdir -p " $1 "
60+ mv " ${TMPREPO} /.git" " $TARGET "
Original file line number Diff line number Diff line change @@ -18,6 +18,18 @@ if [ ! -d "${SCRIPT_DIR}/../.git" ]; then
1818 git config --list
1919fi
2020
21+ # Generate additional testing git repos, if not already present.
22+ mkdir -p " ${SCRIPT_DIR} /repo"
23+ if [ ! -d " ${SCRIPT_DIR} /repo/bar" ]; then
24+ " ${SCRIPT_DIR} /genbar" " ${SCRIPT_DIR} /repo"
25+ fi
26+ if [ ! -d " ${SCRIPT_DIR} /repo/foo" ]; then
27+ " ${SCRIPT_DIR} /genfoo" " ${SCRIPT_DIR} /repo"
28+ fi
29+ if [ ! -d " ${SCRIPT_DIR} /repo/init" ]; then
30+ " ${SCRIPT_DIR} /geninit" " ${SCRIPT_DIR} /repo"
31+ fi
32+
2133BASHLIB=$(
2234 find " $PWD " / -type d -name bin -o -type d -name lib | grep -v " \/\.pc\/" | tr ' \n' ' :'
2335)
You can’t perform that action at this time.
0 commit comments