eac_git 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eac_git/local/remote.rb +0 -2
- data/lib/eac_git/local/subrepo/config.rb +2 -0
- data/lib/eac_git/remote_like/ls_result.rb +1 -1
- data/lib/eac_git/remote_like.rb +0 -1
- data/lib/eac_git/rspec/stubbed_git_local_repo.rb +0 -2
- data/lib/eac_git/rspec.rb +0 -1
- data/lib/eac_git/version.rb +1 -1
- data/lib/eac_git.rb +0 -2
- data/vendor/git-subrepo/.fish.rc +20 -0
- data/vendor/git-subrepo/.gitattributes +1 -0
- data/vendor/git-subrepo/.github/workflows/test.yml +29 -0
- data/vendor/git-subrepo/.gitignore +1 -0
- data/vendor/git-subrepo/.gitrepo +7 -0
- data/vendor/git-subrepo/.rc +32 -0
- data/vendor/git-subrepo/Changes +66 -0
- data/vendor/git-subrepo/Intro.pod +2 -5
- data/vendor/git-subrepo/Makefile +45 -5
- data/vendor/git-subrepo/Meta +2 -2
- data/vendor/git-subrepo/ReadMe.pod +26 -31
- data/vendor/git-subrepo/doc/git-subrepo.swim +22 -18
- data/vendor/git-subrepo/doc/intro-to-subrepo.swim +2 -4
- data/vendor/git-subrepo/ext/bashplus/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/bashplus/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/bashplus/Changes +19 -0
- data/vendor/git-subrepo/ext/bashplus/License +1 -1
- data/vendor/git-subrepo/ext/bashplus/Makefile +25 -0
- data/vendor/git-subrepo/ext/bashplus/Meta +4 -4
- data/vendor/git-subrepo/ext/bashplus/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/bashplus/bin/bash+ +8 -7
- data/vendor/git-subrepo/ext/bashplus/doc/bash+.swim +1 -1
- data/vendor/git-subrepo/ext/bashplus/lib/bash+.bash +85 -38
- data/vendor/git-subrepo/ext/bashplus/man/man1/bash+.1 +8 -8
- data/vendor/git-subrepo/ext/bashplus/man/man3/bash+.3 +8 -8
- data/vendor/git-subrepo/ext/bashplus/test/base.t +4 -5
- data/vendor/git-subrepo/ext/bashplus/test/die.t +16 -0
- data/vendor/git-subrepo/ext/bashplus/test/fcopy.t +2 -3
- data/vendor/git-subrepo/ext/bashplus/test/{test.bash → setup} +18 -8
- data/vendor/git-subrepo/ext/bashplus/test/shellcheck.t +37 -0
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+-std.t +10 -11
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+.t +10 -11
- data/vendor/git-subrepo/ext/bashplus/test/use.t +8 -5
- data/vendor/git-subrepo/ext/bashplus/test/version-check.t +23 -0
- data/vendor/git-subrepo/ext/test-more-bash/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/test-more-bash/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/Makefile +25 -0
- data/vendor/git-subrepo/ext/test-more-bash/Meta +5 -5
- data/vendor/git-subrepo/ext/test-more-bash/ReadMe.pod +9 -3
- data/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim +7 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Makefile +25 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Meta +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ +8 -7
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/doc/bash+.swim +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash +85 -38
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man1/bash+.1 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man3/bash+.3 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/base.t +4 -4
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/die.t +17 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/fcopy.t +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/{test.bash → setup} +17 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/shellcheck.t +38 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t +10 -10
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+.t +10 -10
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/use.t +8 -4
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.travis.yml +5 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Makefile +30 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Meta +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash +46 -42
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/man/man3/test-tap.3 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/helper.bash +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/shellcheck.t +42 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/tap.t +11 -5
- data/vendor/git-subrepo/ext/test-more-bash/lib/test/more.bash +35 -15
- data/vendor/git-subrepo/ext/test-more-bash/man/man3/test-more.3 +16 -10
- data/vendor/git-subrepo/ext/test-more-bash/test/fail.t +15 -1
- data/vendor/git-subrepo/ext/test-more-bash/test/more.t +12 -4
- data/vendor/git-subrepo/ext/test-more-bash/test/setup +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/test/shellcheck.t +35 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/test/fail1.t +14 -1
- data/vendor/git-subrepo/lib/git-subrepo +375 -260
- data/vendor/git-subrepo/lib/git-subrepo.d/help-functions.bash +21 -22
- data/vendor/git-subrepo/man/man1/git-subrepo.1 +125 -141
- data/vendor/git-subrepo/pkg/bin/generate-completion.pl +0 -7
- data/vendor/git-subrepo/pkg/bin/generate-help-functions.pl +0 -2
- data/vendor/git-subrepo/share/completion.bash +1 -3
- data/vendor/git-subrepo/share/enable-completion.sh +3 -3
- data/vendor/git-subrepo/share/zsh-completion/_git-subrepo +2 -7
- data/vendor/git-subrepo/test/Dockerfile +112 -0
- data/vendor/git-subrepo/test/branch-all.t +6 -6
- data/vendor/git-subrepo/test/branch-rev-list-one-path.t +7 -8
- data/vendor/git-subrepo/test/branch-rev-list.t +7 -8
- data/vendor/git-subrepo/test/branch.t +9 -9
- data/vendor/git-subrepo/test/clean.t +3 -3
- data/vendor/git-subrepo/test/clone-annotated-tag.t +7 -7
- data/vendor/git-subrepo/test/clone.t +20 -25
- data/vendor/git-subrepo/test/config.t +7 -6
- data/vendor/git-subrepo/test/encode.t +17 -17
- data/vendor/git-subrepo/test/error.t +18 -18
- data/vendor/git-subrepo/test/fetch.t +4 -4
- data/vendor/git-subrepo/test/gitignore.t +8 -8
- data/vendor/git-subrepo/test/init.t +6 -7
- data/vendor/git-subrepo/test/issue29.t +3 -3
- data/vendor/git-subrepo/test/issue95.t +2 -2
- data/vendor/git-subrepo/test/issue96.t +3 -3
- data/vendor/git-subrepo/test/pull-all.t +5 -5
- data/vendor/git-subrepo/test/pull-merge.t +16 -15
- data/vendor/git-subrepo/test/pull-message.t +12 -12
- data/vendor/git-subrepo/test/pull-new-branch.t +8 -7
- data/vendor/git-subrepo/test/pull-ours.t +10 -10
- data/vendor/git-subrepo/test/pull-theirs.t +8 -8
- data/vendor/git-subrepo/test/pull-twice.t +4 -4
- data/vendor/git-subrepo/test/pull-worktree.t +5 -5
- data/vendor/git-subrepo/test/pull.t +14 -14
- data/vendor/git-subrepo/test/push-after-init.t +7 -6
- data/vendor/git-subrepo/test/push-after-push-no-changes.t +27 -0
- data/vendor/git-subrepo/test/push-force.t +7 -6
- data/vendor/git-subrepo/test/push-new-branch.t +10 -10
- data/vendor/git-subrepo/test/push-no-changes.t +3 -3
- data/vendor/git-subrepo/test/push-squash.t +7 -7
- data/vendor/git-subrepo/test/push.t +35 -34
- data/vendor/git-subrepo/test/rebase.t +63 -0
- data/vendor/git-subrepo/test/reclone.t +15 -8
- data/vendor/git-subrepo/test/setup +62 -55
- data/vendor/git-subrepo/test/shellcheck.t +37 -0
- data/vendor/git-subrepo/test/status.t +47 -27
- data/vendor/git-subrepo/test/submodule.t +4 -4
- data/vendor/git-subrepo/test/zsh.t +27 -0
- metadata +45 -19
|
@@ -13,8 +13,8 @@ clone-foo-and-bar
|
|
|
13
13
|
|
|
14
14
|
{
|
|
15
15
|
is "$(
|
|
16
|
-
cd $OWNER/bar
|
|
17
|
-
git subrepo --quiet clone
|
|
16
|
+
cd "$OWNER/bar"
|
|
17
|
+
git subrepo --quiet clone "$UPSTREAM/foo"
|
|
18
18
|
add-new-files foo/file
|
|
19
19
|
git subrepo --quiet branch foo
|
|
20
20
|
catch git subrepo branch foo
|
|
@@ -23,7 +23,7 @@ clone-foo-and-bar
|
|
|
23
23
|
"Error OK: can't create a branch that exists"
|
|
24
24
|
|
|
25
25
|
(
|
|
26
|
-
cd $OWNER/bar
|
|
26
|
+
cd "$OWNER/bar"
|
|
27
27
|
git subrepo --quiet clean foo
|
|
28
28
|
git reset --quiet --hard HEAD^
|
|
29
29
|
)
|
|
@@ -55,7 +55,7 @@ clone-foo-and-bar
|
|
|
55
55
|
|
|
56
56
|
{
|
|
57
57
|
like "$(
|
|
58
|
-
cd $OWNER/bar
|
|
58
|
+
cd "$OWNER/bar"
|
|
59
59
|
catch git subrepo pull /home/user/bar/foo
|
|
60
60
|
)" \
|
|
61
61
|
"git-subrepo: The subdir '.*/home/user/bar/foo' should not be absolute path." \
|
|
@@ -66,8 +66,8 @@ clone-foo-and-bar
|
|
|
66
66
|
# XXX add 'commit' to cmds here when implemented:
|
|
67
67
|
for cmd in pull push fetch branch commit clean; do
|
|
68
68
|
is "$(
|
|
69
|
-
cd $OWNER/bar
|
|
70
|
-
catch git subrepo $cmd
|
|
69
|
+
cd "$OWNER/bar"
|
|
70
|
+
catch git subrepo "$cmd"
|
|
71
71
|
)" \
|
|
72
72
|
"git-subrepo: Command '$cmd' requires arg 'subdir'." \
|
|
73
73
|
"Error OK: check that '$cmd' requires subdir"
|
|
@@ -76,7 +76,7 @@ clone-foo-and-bar
|
|
|
76
76
|
|
|
77
77
|
{
|
|
78
78
|
is "$(
|
|
79
|
-
cd $OWNER/bar
|
|
79
|
+
cd "$OWNER/bar"
|
|
80
80
|
catch git subrepo clone foo bar baz quux
|
|
81
81
|
)" \
|
|
82
82
|
"git-subrepo: Unknown argument(s) 'baz quux' for 'clone' command." \
|
|
@@ -85,7 +85,7 @@ clone-foo-and-bar
|
|
|
85
85
|
|
|
86
86
|
{
|
|
87
87
|
is "$(
|
|
88
|
-
cd $OWNER/bar
|
|
88
|
+
cd "$OWNER/bar"
|
|
89
89
|
catch git subrepo clone .git
|
|
90
90
|
)" \
|
|
91
91
|
"git-subrepo: Can't determine subdir from '.git'." \
|
|
@@ -94,7 +94,7 @@ clone-foo-and-bar
|
|
|
94
94
|
|
|
95
95
|
{
|
|
96
96
|
is "$(
|
|
97
|
-
cd $OWNER/bar
|
|
97
|
+
cd "$OWNER/bar"
|
|
98
98
|
catch git subrepo pull lala
|
|
99
99
|
)" \
|
|
100
100
|
"git-subrepo: No 'lala/.gitrepo' file." \
|
|
@@ -103,14 +103,14 @@ clone-foo-and-bar
|
|
|
103
103
|
|
|
104
104
|
{
|
|
105
105
|
is "$(
|
|
106
|
-
cd $OWNER/bar
|
|
107
|
-
git checkout --quiet $(git rev-parse master)
|
|
106
|
+
cd "$OWNER/bar"
|
|
107
|
+
git checkout --quiet "$(git rev-parse master)"
|
|
108
108
|
catch git subrepo status
|
|
109
109
|
)" \
|
|
110
110
|
"git-subrepo: Must be on a branch to run this command." \
|
|
111
111
|
"Error OK: check repo is on a branch"
|
|
112
112
|
(
|
|
113
|
-
cd $OWNER/bar
|
|
113
|
+
cd "$OWNER/bar"
|
|
114
114
|
git checkout --quiet master
|
|
115
115
|
)
|
|
116
116
|
}
|
|
@@ -126,15 +126,15 @@ clone-foo-and-bar
|
|
|
126
126
|
|
|
127
127
|
{
|
|
128
128
|
like "$(
|
|
129
|
-
cd $OWNER/bar
|
|
129
|
+
cd "$OWNER/bar"
|
|
130
130
|
touch me
|
|
131
131
|
git add me
|
|
132
|
-
catch git subrepo clone
|
|
132
|
+
catch git subrepo clone "$UPSTREAM/foo"
|
|
133
133
|
)" \
|
|
134
134
|
"git-subrepo: Can't clone subrepo. Working tree has changes." \
|
|
135
135
|
"Error OK: check no working tree changes"
|
|
136
136
|
(
|
|
137
|
-
cd $OWNER/bar
|
|
137
|
+
cd "$OWNER/bar"
|
|
138
138
|
git reset --quiet --hard
|
|
139
139
|
)
|
|
140
140
|
}
|
|
@@ -150,7 +150,7 @@ clone-foo-and-bar
|
|
|
150
150
|
|
|
151
151
|
{
|
|
152
152
|
is "$(
|
|
153
|
-
cd $OWNER/bar
|
|
153
|
+
cd "$OWNER/bar"
|
|
154
154
|
catch git subrepo clone dummy bard
|
|
155
155
|
)" \
|
|
156
156
|
"git-subrepo: The subdir 'bard' exists and is not empty." \
|
|
@@ -159,10 +159,10 @@ clone-foo-and-bar
|
|
|
159
159
|
|
|
160
160
|
{
|
|
161
161
|
is "$(
|
|
162
|
-
cd $OWNER/bar
|
|
162
|
+
cd "$OWNER/bar"
|
|
163
163
|
catch git subrepo clone dummy-repo
|
|
164
164
|
)" \
|
|
165
|
-
"git-subrepo: Command failed: 'git ls-remote dummy-repo'." \
|
|
165
|
+
"git-subrepo: Command failed: 'git ls-remote --symref dummy-repo'." \
|
|
166
166
|
"Error OK: clone non-repo"
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -11,7 +11,7 @@ clone-foo-and-bar
|
|
|
11
11
|
subrepo-clone-bar-into-foo
|
|
12
12
|
|
|
13
13
|
(
|
|
14
|
-
cd $OWNER/bar
|
|
14
|
+
cd "$OWNER/bar"
|
|
15
15
|
add-new-files Bar2
|
|
16
16
|
git tag -a CoolTag -m "Should stay in subrepo"
|
|
17
17
|
git push
|
|
@@ -21,17 +21,17 @@ subrepo-clone-bar-into-foo
|
|
|
21
21
|
# Fetch information
|
|
22
22
|
{
|
|
23
23
|
is "$(
|
|
24
|
-
cd $OWNER/foo
|
|
24
|
+
cd "$OWNER/foo"
|
|
25
25
|
git subrepo fetch bar
|
|
26
26
|
)" \
|
|
27
|
-
"Fetched 'bar' from '
|
|
27
|
+
"Fetched 'bar' from '$UPSTREAM/bar' (master)." \
|
|
28
28
|
'subrepo fetch command output is correct'
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
# Check that there is no tags fetched
|
|
32
32
|
{
|
|
33
33
|
is "$(
|
|
34
|
-
cd $OWNER/foo
|
|
34
|
+
cd "$OWNER/foo"
|
|
35
35
|
git tag -l 'CoolTag'
|
|
36
36
|
)" \
|
|
37
37
|
"" \
|
|
@@ -11,13 +11,13 @@ clone-foo-and-bar
|
|
|
11
11
|
subrepo-clone-bar-into-foo
|
|
12
12
|
|
|
13
13
|
(
|
|
14
|
-
cd $OWNER/bar
|
|
14
|
+
cd "$OWNER/bar"
|
|
15
15
|
add-new-files Bar2
|
|
16
16
|
git push
|
|
17
17
|
) &> /dev/null || die
|
|
18
18
|
|
|
19
19
|
(
|
|
20
|
-
cd $OWNER/foo
|
|
20
|
+
cd "$OWNER/foo"
|
|
21
21
|
echo ".*" >> .gitignore
|
|
22
22
|
git add .gitignore
|
|
23
23
|
git commit -m "Add gitignore"
|
|
@@ -29,10 +29,10 @@ subrepo-clone-bar-into-foo
|
|
|
29
29
|
# Do the pull and check output:
|
|
30
30
|
{
|
|
31
31
|
is "$(
|
|
32
|
-
cd $OWNER/foo
|
|
32
|
+
cd "$OWNER/foo"
|
|
33
33
|
git subrepo pull bar
|
|
34
34
|
)" \
|
|
35
|
-
"Subrepo 'bar' pulled from '
|
|
35
|
+
"Subrepo 'bar' pulled from '$UPSTREAM/bar' (master)." \
|
|
36
36
|
'subrepo pull command output is correct'
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -46,14 +46,14 @@ gitrepo=$OWNER/foo/bar/.gitrepo
|
|
|
46
46
|
|
|
47
47
|
# Test foo/bar/.gitrepo file contents:
|
|
48
48
|
{
|
|
49
|
-
foo_pull_commit
|
|
50
|
-
bar_head_commit
|
|
49
|
+
foo_pull_commit=$(cd "$OWNER/foo"; git rev-parse HEAD^)
|
|
50
|
+
bar_head_commit=$(cd "$OWNER/bar"; git rev-parse HEAD)
|
|
51
51
|
test-gitrepo-comment-block
|
|
52
|
-
test-gitrepo-field "remote" "
|
|
52
|
+
test-gitrepo-field "remote" "$UPSTREAM/bar"
|
|
53
53
|
test-gitrepo-field "branch" "master"
|
|
54
54
|
test-gitrepo-field "commit" "$bar_head_commit"
|
|
55
55
|
test-gitrepo-field "parent" "$foo_pull_commit"
|
|
56
|
-
test-gitrepo-field "cmdver" "
|
|
56
|
+
test-gitrepo-field "cmdver" "$(git subrepo --version)"
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
done_testing
|
|
@@ -6,7 +6,7 @@ source test/setup
|
|
|
6
6
|
|
|
7
7
|
use Test::More
|
|
8
8
|
|
|
9
|
-
git clone $UPSTREAM/init $OWNER/init &>/dev/null
|
|
9
|
+
git clone "$UPSTREAM/init" "$OWNER/init" &>/dev/null
|
|
10
10
|
|
|
11
11
|
gitrepo=$OWNER/init/doc/.gitrepo
|
|
12
12
|
|
|
@@ -20,10 +20,10 @@ gitrepo=$OWNER/init/doc/.gitrepo
|
|
|
20
20
|
"!$gitrepo"
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
output
|
|
23
|
+
output=$(
|
|
24
24
|
cd "$OWNER/init"
|
|
25
25
|
git subrepo init doc
|
|
26
|
-
)
|
|
26
|
+
)
|
|
27
27
|
|
|
28
28
|
is "$output" "Subrepo created from 'doc' (with no remote)." \
|
|
29
29
|
'Command output is correct'
|
|
@@ -35,18 +35,17 @@ is "$output" "Subrepo created from 'doc' (with no remote)." \
|
|
|
35
35
|
|
|
36
36
|
# Test init/doc/.gitrepo file contents:
|
|
37
37
|
{
|
|
38
|
-
init_clone_commit="$(cd $OWNER/init; git rev-parse HEAD^)"
|
|
39
38
|
test-gitrepo-comment-block
|
|
40
39
|
test-gitrepo-field "remote" "none"
|
|
41
40
|
test-gitrepo-field "branch" "master"
|
|
42
41
|
test-gitrepo-field "commit" ""
|
|
43
42
|
test-gitrepo-field "parent" ""
|
|
44
43
|
test-gitrepo-field "method" "merge"
|
|
45
|
-
test-gitrepo-field "cmdver" "
|
|
44
|
+
test-gitrepo-field "cmdver" "$(git subrepo --version)"
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
rm -fr "$OWNER/init"
|
|
49
|
-
git clone $UPSTREAM/init $OWNER/init &>/dev/null
|
|
48
|
+
git clone "$UPSTREAM/init" "$OWNER/init" &>/dev/null
|
|
50
49
|
(
|
|
51
50
|
cd "$OWNER/init"
|
|
52
51
|
git subrepo init doc -r git@github.com:user/repo -b foo -M rebase
|
|
@@ -57,7 +56,7 @@ test-gitrepo-field "branch" "foo"
|
|
|
57
56
|
test-gitrepo-field "commit" ""
|
|
58
57
|
test-gitrepo-field "parent" ""
|
|
59
58
|
test-gitrepo-field "method" "rebase"
|
|
60
|
-
test-gitrepo-field "cmdver" "
|
|
59
|
+
test-gitrepo-field "cmdver" "$(git subrepo --version)"
|
|
61
60
|
|
|
62
61
|
done_testing
|
|
63
62
|
|
|
@@ -40,7 +40,7 @@ cd "$TMP"
|
|
|
40
40
|
touch main1
|
|
41
41
|
git add main1
|
|
42
42
|
git commit -m "Initial main1"
|
|
43
|
-
git subrepo clone ../share share -b
|
|
43
|
+
git subrepo clone ../share share -b "$DEFAULTBRANCH"
|
|
44
44
|
) > /dev/null
|
|
45
45
|
|
|
46
46
|
# `subrepo clone` the share repo into main2:
|
|
@@ -49,7 +49,7 @@ cd "$TMP"
|
|
|
49
49
|
touch main2
|
|
50
50
|
git add main2
|
|
51
51
|
git commit -m "Initial main2"
|
|
52
|
-
git subrepo clone ../share share -b
|
|
52
|
+
git subrepo clone ../share share -b "$DEFAULTBRANCH"
|
|
53
53
|
) > /dev/null
|
|
54
54
|
|
|
55
55
|
|
|
@@ -64,7 +64,7 @@ msg_main1="main1 initial add to subrepo"
|
|
|
64
64
|
git subrepo push share
|
|
65
65
|
) &> /dev/null
|
|
66
66
|
|
|
67
|
-
ok "
|
|
67
|
+
ok "$(! git:branch-exists "subrepo-push/share")" \
|
|
68
68
|
"The subrepo-push/share branch was deleted after push"
|
|
69
69
|
|
|
70
70
|
# TODO Check the state of refs made
|
|
@@ -46,7 +46,7 @@ use Test::More
|
|
|
46
46
|
touch feature
|
|
47
47
|
git add feature
|
|
48
48
|
git commit -m "feature added"
|
|
49
|
-
git checkout
|
|
49
|
+
git checkout "$DEFAULTBRANCH"
|
|
50
50
|
) &> /dev/null
|
|
51
51
|
|
|
52
52
|
# Commit directly to subrepo
|
|
@@ -89,7 +89,7 @@ use Test::More
|
|
|
89
89
|
cd host
|
|
90
90
|
git subrepo pull sub
|
|
91
91
|
)" \
|
|
92
|
-
"Subrepo 'sub' pulled from '../sub' (
|
|
92
|
+
"Subrepo 'sub' pulled from '../sub' ($DEFAULTBRANCH)."
|
|
93
93
|
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -81,15 +81,15 @@ use Test::More
|
|
|
81
81
|
cd host
|
|
82
82
|
git subrepo pull sub
|
|
83
83
|
)" \
|
|
84
|
-
"Subrepo 'sub' pulled from '../sub' (
|
|
84
|
+
"Subrepo 'sub' pulled from '../sub' ($DEFAULTBRANCH)."
|
|
85
85
|
|
|
86
86
|
# Push subrepo changes
|
|
87
87
|
# expected: successful push without conflicts
|
|
88
88
|
is "$(
|
|
89
89
|
cd host
|
|
90
|
-
git subrepo push sub -b
|
|
90
|
+
git subrepo push sub -b "$DEFAULTBRANCH" -u
|
|
91
91
|
)" \
|
|
92
|
-
"Subrepo 'sub' pushed to '../sub' (
|
|
92
|
+
"Subrepo 'sub' pushed to '../sub' ($DEFAULTBRANCH)."
|
|
93
93
|
|
|
94
94
|
done_testing 2
|
|
95
95
|
|
|
@@ -9,26 +9,26 @@ use Test::More
|
|
|
9
9
|
clone-foo-and-bar
|
|
10
10
|
|
|
11
11
|
(
|
|
12
|
-
cd $OWNER/foo
|
|
12
|
+
cd "$OWNER/foo"
|
|
13
13
|
git subrepo clone ../bar bar1
|
|
14
14
|
git subrepo clone ../bar bar2
|
|
15
15
|
) &> /dev/null || die
|
|
16
16
|
|
|
17
17
|
(
|
|
18
|
-
cd $OWNER/bar
|
|
18
|
+
cd "$OWNER/bar"
|
|
19
19
|
modify-files Bar
|
|
20
20
|
) &> /dev/null || die
|
|
21
21
|
|
|
22
22
|
(
|
|
23
|
-
cd $OWNER/foo
|
|
23
|
+
cd "$OWNER/foo"
|
|
24
24
|
git subrepo pull --all
|
|
25
25
|
) &> /dev/null || die
|
|
26
26
|
|
|
27
27
|
{
|
|
28
|
-
is "$(cat $OWNER/foo/bar1/Bar)" \
|
|
28
|
+
is "$(cat "$OWNER/foo/bar1/Bar")" \
|
|
29
29
|
"a new line" \
|
|
30
30
|
'bar1/Bar content correct'
|
|
31
|
-
is "$(cat $OWNER/foo/bar2/Bar)" \
|
|
31
|
+
is "$(cat "$OWNER/foo/bar2/Bar")" \
|
|
32
32
|
"a new line" \
|
|
33
33
|
'bar2/Bar content correct'
|
|
34
34
|
}
|
|
@@ -13,37 +13,38 @@ subrepo-clone-bar-into-foo
|
|
|
13
13
|
note "Pull - Conflict - Merge ours/theirs - Push"
|
|
14
14
|
|
|
15
15
|
(
|
|
16
|
-
cd $OWNER/bar
|
|
16
|
+
cd "$OWNER/bar"
|
|
17
17
|
add-new-files Bar2
|
|
18
18
|
git push
|
|
19
19
|
) &> /dev/null || die
|
|
20
20
|
|
|
21
|
+
# shellcheck disable=2034
|
|
21
22
|
gitrepo=$OWNER/foo/bar/.gitrepo
|
|
22
23
|
# Test foo/bar/.gitrepo file contents:
|
|
23
24
|
{
|
|
24
|
-
foo_pull_commit
|
|
25
|
-
bar_head_commit
|
|
25
|
+
foo_pull_commit=$(cd "$OWNER/foo"; git rev-parse HEAD^)
|
|
26
|
+
bar_head_commit=$(cd "$OWNER/bar"; git rev-parse HEAD^)
|
|
26
27
|
test-gitrepo-field "commit" "$bar_head_commit"
|
|
27
28
|
test-gitrepo-field "parent" "$foo_pull_commit"
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
foo_pull_commit
|
|
31
|
+
foo_pull_commit=$(cd "$OWNER/foo"; git rev-parse HEAD)
|
|
31
32
|
|
|
32
33
|
(
|
|
33
|
-
cd $OWNER/foo
|
|
34
|
+
cd "$OWNER/foo"
|
|
34
35
|
git subrepo pull bar
|
|
35
36
|
modify-files-ex bar/Bar2
|
|
36
37
|
git push
|
|
37
38
|
) &> /dev/null || die
|
|
38
39
|
|
|
39
40
|
(
|
|
40
|
-
cd $OWNER/bar
|
|
41
|
+
cd "$OWNER/bar"
|
|
41
42
|
modify-files-ex Bar2
|
|
42
43
|
git push
|
|
43
44
|
) &> /dev/null || die
|
|
44
45
|
|
|
45
46
|
(
|
|
46
|
-
cd $OWNER/foo
|
|
47
|
+
cd "$OWNER/foo"
|
|
47
48
|
git subrepo pull bar || {
|
|
48
49
|
cd .git/tmp/subrepo/bar
|
|
49
50
|
echo "Merged Bar2" > Bar2
|
|
@@ -59,13 +60,13 @@ test-exists \
|
|
|
59
60
|
"$OWNER/foo/bar/Bar2" \
|
|
60
61
|
"$OWNER/bar/Bar2" \
|
|
61
62
|
|
|
62
|
-
is "$(cat $OWNER/foo/bar/Bar2)" \
|
|
63
|
+
is "$(cat "$OWNER/foo/bar/Bar2")" \
|
|
63
64
|
"Merged Bar2" \
|
|
64
65
|
"The readme file in the mainrepo is merged"
|
|
65
66
|
|
|
66
67
|
# Check commit messages
|
|
67
68
|
{
|
|
68
|
-
foo_new_commit_message
|
|
69
|
+
foo_new_commit_message=$(cd "$OWNER/foo"; git log --format=%B -n 1)
|
|
69
70
|
like "$foo_new_commit_message" \
|
|
70
71
|
"git subrepo commit \(merge\) bar" \
|
|
71
72
|
"subrepo pull should have merge message"
|
|
@@ -73,26 +74,26 @@ is "$(cat $OWNER/foo/bar/Bar2)" \
|
|
|
73
74
|
|
|
74
75
|
# Test foo/bar/.gitrepo file contents:
|
|
75
76
|
{
|
|
76
|
-
bar_head_commit
|
|
77
|
+
bar_head_commit=$(cd "$OWNER/bar"; git rev-parse HEAD)
|
|
77
78
|
test-gitrepo-field "commit" "$bar_head_commit"
|
|
78
79
|
test-gitrepo-field "parent" "$foo_pull_commit"
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
(
|
|
82
|
-
cd $OWNER/foo
|
|
83
|
+
cd "$OWNER/foo"
|
|
83
84
|
git subrepo push bar
|
|
84
85
|
) &> /dev/null || die
|
|
85
86
|
|
|
86
87
|
# Check commit messages
|
|
87
88
|
{
|
|
88
|
-
foo_new_commit_message
|
|
89
|
+
foo_new_commit_message=$(cd "$OWNER/foo"; git log --format=%B -n 1)
|
|
89
90
|
like "$foo_new_commit_message" \
|
|
90
91
|
"git subrepo push bar" \
|
|
91
92
|
"subrepo push should not have merge message"
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
(
|
|
95
|
-
cd $OWNER/bar
|
|
96
|
+
cd "$OWNER/bar"
|
|
96
97
|
git pull
|
|
97
98
|
) &> /dev/null || die
|
|
98
99
|
|
|
@@ -100,11 +101,11 @@ test-exists \
|
|
|
100
101
|
"$OWNER/foo/bar/Bar2" \
|
|
101
102
|
"$OWNER/bar/Bar2" \
|
|
102
103
|
|
|
103
|
-
is "$(cat $OWNER/foo/bar/Bar2)" \
|
|
104
|
+
is "$(cat "$OWNER/foo/bar/Bar2")" \
|
|
104
105
|
"Merged Bar2" \
|
|
105
106
|
"The readme file in the mainrepo is merged"
|
|
106
107
|
|
|
107
|
-
is "$(cat $OWNER/bar/Bar2)" \
|
|
108
|
+
is "$(cat "$OWNER/bar/Bar2")" \
|
|
108
109
|
"Merged Bar2" \
|
|
109
110
|
"The readme file in the subrepo is merged"
|
|
110
111
|
|
|
@@ -11,7 +11,7 @@ clone-foo-and-bar
|
|
|
11
11
|
subrepo-clone-bar-into-foo
|
|
12
12
|
|
|
13
13
|
(
|
|
14
|
-
cd $OWNER/bar
|
|
14
|
+
cd "$OWNER/bar"
|
|
15
15
|
add-new-files Bar2
|
|
16
16
|
git push
|
|
17
17
|
) &> /dev/null || die
|
|
@@ -20,23 +20,23 @@ subrepo-clone-bar-into-foo
|
|
|
20
20
|
# Do the pull and check output, use -m:
|
|
21
21
|
{
|
|
22
22
|
is "$(
|
|
23
|
-
cd $OWNER/foo
|
|
23
|
+
cd "$OWNER/foo"
|
|
24
24
|
git subrepo pull -m 'Hello World' bar
|
|
25
25
|
)" \
|
|
26
|
-
"Subrepo 'bar' pulled from '
|
|
26
|
+
"Subrepo 'bar' pulled from '$UPSTREAM/bar' (master)." \
|
|
27
27
|
'subrepo pull command output is correct'
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
# Check -m commit messages
|
|
31
31
|
{
|
|
32
|
-
foo_new_commit_message
|
|
32
|
+
foo_new_commit_message=$(cd "$OWNER/foo"; git log --format=%B -n 1)
|
|
33
33
|
like "$foo_new_commit_message" \
|
|
34
34
|
"Hello World" \
|
|
35
35
|
"subrepo pull commit message"
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
(
|
|
39
|
-
cd $OWNER/bar
|
|
39
|
+
cd "$OWNER/bar"
|
|
40
40
|
add-new-files Bar3
|
|
41
41
|
git push
|
|
42
42
|
) &> /dev/null || die
|
|
@@ -44,23 +44,23 @@ subrepo-clone-bar-into-foo
|
|
|
44
44
|
# Do the pull and check output, use -e:
|
|
45
45
|
{
|
|
46
46
|
is "$(
|
|
47
|
-
cd $OWNER/foo
|
|
47
|
+
cd "$OWNER/foo"
|
|
48
48
|
GIT_EDITOR='echo cowabunga >' git subrepo pull -e bar
|
|
49
49
|
)" \
|
|
50
|
-
"Subrepo 'bar' pulled from '
|
|
50
|
+
"Subrepo 'bar' pulled from '$UPSTREAM/bar' (master)." \
|
|
51
51
|
'subrepo pull command output is correct'
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
# Check -e commit messages
|
|
55
55
|
{
|
|
56
|
-
foo_new_commit_message="$(cd $OWNER/foo; git log --format=%B -n 1)"
|
|
56
|
+
foo_new_commit_message="$(cd "$OWNER/foo"; git log --format=%B -n 1)"
|
|
57
57
|
like "$foo_new_commit_message" \
|
|
58
58
|
"cowabunga" \
|
|
59
59
|
"subrepo pull edit commit message"
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
(
|
|
63
|
-
cd $OWNER/bar
|
|
63
|
+
cd "$OWNER/bar"
|
|
64
64
|
add-new-files Bar4
|
|
65
65
|
git push
|
|
66
66
|
) &> /dev/null || die
|
|
@@ -68,16 +68,16 @@ subrepo-clone-bar-into-foo
|
|
|
68
68
|
# Do the pull and check output, use -e and -m:
|
|
69
69
|
{
|
|
70
70
|
is "$(
|
|
71
|
-
cd $OWNER/foo
|
|
71
|
+
cd "$OWNER/foo"
|
|
72
72
|
GIT_EDITOR=true git subrepo pull -e -m original bar
|
|
73
73
|
)" \
|
|
74
|
-
"Subrepo 'bar' pulled from '
|
|
74
|
+
"Subrepo 'bar' pulled from '$UPSTREAM/bar' (master)." \
|
|
75
75
|
'subrepo pull command output is correct'
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
# Check -e commit messages
|
|
79
79
|
{
|
|
80
|
-
foo_new_commit_message="$(cd $OWNER/foo; git log --format=%B -n 1)"
|
|
80
|
+
foo_new_commit_message="$(cd "$OWNER/foo"; git log --format=%B -n 1)"
|
|
81
81
|
like "$foo_new_commit_message" \
|
|
82
82
|
"original" \
|
|
83
83
|
"subrepo pull edit and message commit message"
|
|
@@ -15,13 +15,14 @@ subrepo-clone-bar-into-foo
|
|
|
15
15
|
) &> /dev/null || die
|
|
16
16
|
|
|
17
17
|
# Test subrepo file content:
|
|
18
|
+
# shellcheck disable=2034
|
|
18
19
|
gitrepo=$OWNER/foo/bar/.gitrepo
|
|
19
20
|
|
|
20
21
|
{
|
|
21
|
-
foo_pull_commit=$(cd "$OWNER/foo"; git rev-parse HEAD^)
|
|
22
|
-
bar_head_commit=$(cd "$OWNER/bar"; git rev-parse HEAD)
|
|
22
|
+
foo_pull_commit=$(cd "$OWNER/foo" || exit; git rev-parse HEAD^)
|
|
23
|
+
bar_head_commit=$(cd "$OWNER/bar" || exit; git rev-parse HEAD)
|
|
23
24
|
test-gitrepo-comment-block
|
|
24
|
-
test-gitrepo-field remote "
|
|
25
|
+
test-gitrepo-field remote "$UPSTREAM/bar"
|
|
25
26
|
test-gitrepo-field branch master
|
|
26
27
|
test-gitrepo-field commit "$bar_head_commit"
|
|
27
28
|
test-gitrepo-field parent "$foo_pull_commit"
|
|
@@ -34,10 +35,10 @@ gitrepo=$OWNER/foo/bar/.gitrepo
|
|
|
34
35
|
) &> /dev/null || die
|
|
35
36
|
|
|
36
37
|
{
|
|
37
|
-
foo_pull_commit=$(cd "$OWNER/foo"; git rev-parse HEAD^)
|
|
38
|
-
bar_head_commit=$(cd "$OWNER/bar"; git rev-parse HEAD)
|
|
38
|
+
foo_pull_commit=$(cd "$OWNER/foo" || exit; git rev-parse HEAD^)
|
|
39
|
+
bar_head_commit=$(cd "$OWNER/bar" || exit; git rev-parse HEAD)
|
|
39
40
|
test-gitrepo-comment-block
|
|
40
|
-
test-gitrepo-field remote "
|
|
41
|
+
test-gitrepo-field remote "$UPSTREAM/bar"
|
|
41
42
|
test-gitrepo-field branch branch1
|
|
42
43
|
test-gitrepo-field commit "$bar_head_commit"
|
|
43
44
|
test-gitrepo-field parent "$foo_pull_commit"
|
|
@@ -46,7 +47,7 @@ gitrepo=$OWNER/foo/bar/.gitrepo
|
|
|
46
47
|
|
|
47
48
|
{
|
|
48
49
|
is "$(
|
|
49
|
-
cd $OWNER/foo
|
|
50
|
+
cd "$OWNER/foo" || exit
|
|
50
51
|
git subrepo pull bar
|
|
51
52
|
)" \
|
|
52
53
|
"Subrepo 'bar' is up to date." \
|
|
@@ -19,13 +19,13 @@ note "Pull - Conflict - Use ours - Push"
|
|
|
19
19
|
#
|
|
20
20
|
|
|
21
21
|
(
|
|
22
|
-
cd $OWNER/bar
|
|
22
|
+
cd "$OWNER/bar"
|
|
23
23
|
add-new-files Bar2
|
|
24
24
|
git push
|
|
25
25
|
) &> /dev/null || die
|
|
26
26
|
|
|
27
27
|
(
|
|
28
|
-
cd $OWNER/foo
|
|
28
|
+
cd "$OWNER/foo"
|
|
29
29
|
git subrepo pull bar
|
|
30
30
|
modify-files-ex bar/Bar2
|
|
31
31
|
cat bar/Bar2
|
|
@@ -33,15 +33,15 @@ note "Pull - Conflict - Use ours - Push"
|
|
|
33
33
|
) &> /dev/null || die
|
|
34
34
|
|
|
35
35
|
(
|
|
36
|
-
cd $OWNER/bar
|
|
36
|
+
cd "$OWNER/bar"
|
|
37
37
|
modify-files-ex Bar2
|
|
38
38
|
git push
|
|
39
39
|
) &> /dev/null || die
|
|
40
40
|
|
|
41
|
-
before
|
|
41
|
+
before=$(date -r "$OWNER/foo/Foo" '+%s')
|
|
42
42
|
|
|
43
43
|
(
|
|
44
|
-
cd $OWNER/foo
|
|
44
|
+
cd "$OWNER/foo"
|
|
45
45
|
git subrepo pull bar || {
|
|
46
46
|
cd .git/tmp/subrepo/bar
|
|
47
47
|
git checkout --ours Bar2
|
|
@@ -54,7 +54,7 @@ before="$(date -r $OWNER/foo/Foo '+%s')"
|
|
|
54
54
|
) &> /dev/null || die
|
|
55
55
|
|
|
56
56
|
sleep 1
|
|
57
|
-
after
|
|
57
|
+
after=$(date -r "$OWNER/foo/Foo" '+%s')
|
|
58
58
|
|
|
59
59
|
is "$before" "$after" \
|
|
60
60
|
"No modification on Foo"
|
|
@@ -63,17 +63,17 @@ test-exists \
|
|
|
63
63
|
"$OWNER/foo/bar/Bar2" \
|
|
64
64
|
"$OWNER/bar/Bar2" \
|
|
65
65
|
|
|
66
|
-
is "$(cat $OWNER/foo/bar/Bar2)" \
|
|
66
|
+
is "$(cat "$OWNER/foo/bar/Bar2")" \
|
|
67
67
|
"new file Bar2"$'\n'"bar/Bar2" \
|
|
68
68
|
"The readme file in the mainrepo is ours"
|
|
69
69
|
|
|
70
70
|
(
|
|
71
|
-
cd $OWNER/foo
|
|
71
|
+
cd "$OWNER/foo"
|
|
72
72
|
git subrepo push bar
|
|
73
73
|
) &> /dev/null || die
|
|
74
74
|
|
|
75
75
|
(
|
|
76
|
-
cd $OWNER/bar
|
|
76
|
+
cd "$OWNER/bar"
|
|
77
77
|
git pull
|
|
78
78
|
) &> /dev/null || die
|
|
79
79
|
|
|
@@ -81,7 +81,7 @@ test-exists \
|
|
|
81
81
|
"$OWNER/foo/bar/Bar2" \
|
|
82
82
|
"$OWNER/bar/Bar2" \
|
|
83
83
|
|
|
84
|
-
is "$(cat $OWNER/bar/Bar2)" \
|
|
84
|
+
is "$(cat "$OWNER/bar/Bar2")" \
|
|
85
85
|
"new file Bar2"$'\n'"bar/Bar2" \
|
|
86
86
|
"The readme file in the subrepo is ours"
|
|
87
87
|
|