eac_git 0.1.0 → 0.3.3
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/executables.rb +24 -4
- data/lib/eac_git/local.rb +5 -1
- data/lib/eac_git/local/dirty_files.rb +37 -0
- data/lib/eac_git/rspec.rb +17 -0
- data/lib/eac_git/version.rb +1 -1
- data/vendor/git-subrepo/Changes +110 -0
- data/vendor/git-subrepo/Intro.pod +509 -0
- data/vendor/git-subrepo/License +21 -0
- data/vendor/git-subrepo/Makefile +82 -0
- data/vendor/git-subrepo/Meta +28 -0
- data/vendor/git-subrepo/ReadMe.pod +698 -0
- data/vendor/git-subrepo/doc/comparison.swim +35 -0
- data/vendor/git-subrepo/doc/git-subrepo.swim +608 -0
- data/vendor/git-subrepo/doc/intro-to-subrepo.swim +387 -0
- data/vendor/git-subrepo/ext/bashplus/Changes +15 -0
- data/vendor/git-subrepo/ext/bashplus/License +21 -0
- data/vendor/git-subrepo/ext/bashplus/Makefile +45 -0
- data/vendor/git-subrepo/ext/bashplus/Meta +28 -0
- data/vendor/git-subrepo/ext/bashplus/ReadMe.pod +77 -0
- data/vendor/git-subrepo/ext/bashplus/bin/bash+ +43 -0
- data/vendor/git-subrepo/ext/bashplus/doc/bash+.swim +61 -0
- data/vendor/git-subrepo/ext/bashplus/lib/bash+.bash +92 -0
- data/vendor/git-subrepo/ext/bashplus/man/man1/bash+.1 +134 -0
- data/vendor/git-subrepo/ext/bashplus/man/man3/bash+.3 +134 -0
- data/vendor/git-subrepo/ext/bashplus/test/base.t +12 -0
- data/vendor/git-subrepo/ext/bashplus/test/fcopy.t +22 -0
- data/vendor/git-subrepo/ext/bashplus/test/lib/foo/bar.bash +3 -0
- data/vendor/git-subrepo/ext/bashplus/test/lib/foo/foo.bash +3 -0
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+-std.t +18 -0
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+.t +23 -0
- data/vendor/git-subrepo/ext/bashplus/test/test.bash +70 -0
- data/vendor/git-subrepo/ext/bashplus/test/use.t +19 -0
- data/vendor/git-subrepo/ext/test-more-bash/Changes +15 -0
- data/vendor/git-subrepo/ext/test-more-bash/License +21 -0
- data/vendor/git-subrepo/ext/test-more-bash/Makefile +20 -0
- data/vendor/git-subrepo/ext/test-more-bash/Meta +30 -0
- data/vendor/git-subrepo/ext/test-more-bash/ReadMe.pod +115 -0
- data/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim +89 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Changes +15 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/License +21 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Makefile +45 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Meta +28 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/ReadMe.pod +77 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ +43 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/doc/bash+.swim +61 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash +92 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man1/bash+.1 +134 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man3/bash+.3 +134 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/base.t +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/fcopy.t +22 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/lib/foo/bar.bash +3 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/lib/foo/foo.bash +3 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t +18 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+.t +23 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/test.bash +70 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/use.t +19 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Changes +15 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/License +21 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Makefile +37 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Meta +28 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod +66 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim +48 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash +153 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/man/man3/test-tap.3 +119 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t +13 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/done.t +10 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail.t +20 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t +15 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/helper.bash +9 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/pass.t +9 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/plan.t +10 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/skip_all.t +20 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/tap.t +13 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/bail.t +14 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/fail.t +7 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/fail_fast.t +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-init.t +8 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-plan.t +9 -0
- data/vendor/git-subrepo/ext/test-more-bash/lib/test/more.bash +95 -0
- data/vendor/git-subrepo/ext/test-more-bash/man/man3/test-more.3 +173 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/fail.t +20 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/more.t +20 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/pass.t +9 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/setup +8 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/skip_all.t +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/test/fail1.t +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/test/skip_all.t +10 -0
- data/vendor/git-subrepo/lib/git-subrepo +1903 -0
- data/vendor/git-subrepo/lib/git-subrepo.d/bash+.bash +1 -0
- data/vendor/git-subrepo/lib/git-subrepo.d/help-functions.bash +339 -0
- data/vendor/git-subrepo/man/man1/git-subrepo.1 +743 -0
- data/vendor/git-subrepo/note/0.4.0 +12 -0
- data/vendor/git-subrepo/note/AllGitCmds +148 -0
- data/vendor/git-subrepo/note/Cases +32 -0
- data/vendor/git-subrepo/note/Commands +33 -0
- data/vendor/git-subrepo/note/Dags +199 -0
- data/vendor/git-subrepo/note/Gists +7 -0
- data/vendor/git-subrepo/note/Links +25 -0
- data/vendor/git-subrepo/note/Plugins +10 -0
- data/vendor/git-subrepo/note/Spec +39 -0
- data/vendor/git-subrepo/note/Story1 +57 -0
- data/vendor/git-subrepo/note/ToDo +55 -0
- data/vendor/git-subrepo/note/design.swim +137 -0
- data/vendor/git-subrepo/note/design2.swim +85 -0
- data/vendor/git-subrepo/note/init-test +38 -0
- data/vendor/git-subrepo/note/pull-dance.txt +18 -0
- data/vendor/git-subrepo/note/recreate-rebase-conflict.sh +56 -0
- data/vendor/git-subrepo/note/subtree-rebase-fail-example/test.bash +29 -0
- data/vendor/git-subrepo/note/test-subrepo-push.sh +69 -0
- data/vendor/git-subrepo/note/test.sh +58 -0
- data/vendor/git-subrepo/pkg/bin/generate-completion.pl +210 -0
- data/vendor/git-subrepo/pkg/bin/generate-help-functions.pl +89 -0
- data/vendor/git-subrepo/share/completion.bash +42 -0
- data/vendor/git-subrepo/share/enable-completion.sh +50 -0
- data/vendor/git-subrepo/share/git-completion.bash +2738 -0
- data/vendor/git-subrepo/share/zsh-completion/_git-subrepo +81 -0
- data/vendor/git-subrepo/test/branch-all.t +41 -0
- data/vendor/git-subrepo/test/branch-rev-list-one-path.t +43 -0
- data/vendor/git-subrepo/test/branch-rev-list.t +47 -0
- data/vendor/git-subrepo/test/branch.t +52 -0
- data/vendor/git-subrepo/test/clean.t +43 -0
- data/vendor/git-subrepo/test/clone-annotated-tag.t +45 -0
- data/vendor/git-subrepo/test/clone.t +107 -0
- data/vendor/git-subrepo/test/compile.t +19 -0
- data/vendor/git-subrepo/test/config.t +58 -0
- data/vendor/git-subrepo/test/encode.t +91 -0
- data/vendor/git-subrepo/test/error.t +171 -0
- data/vendor/git-subrepo/test/fetch.t +43 -0
- data/vendor/git-subrepo/test/gitignore.t +61 -0
- data/vendor/git-subrepo/test/init.t +64 -0
- data/vendor/git-subrepo/test/issue29.t +98 -0
- data/vendor/git-subrepo/test/issue95.t +98 -0
- data/vendor/git-subrepo/test/issue96.t +96 -0
- data/vendor/git-subrepo/test/pull-all.t +38 -0
- data/vendor/git-subrepo/test/pull-merge.t +113 -0
- data/vendor/git-subrepo/test/pull-message.t +88 -0
- data/vendor/git-subrepo/test/pull-new-branch.t +58 -0
- data/vendor/git-subrepo/test/pull-ours.t +90 -0
- data/vendor/git-subrepo/test/pull-theirs.t +82 -0
- data/vendor/git-subrepo/test/pull-twice.t +44 -0
- data/vendor/git-subrepo/test/pull-worktree.t +40 -0
- data/vendor/git-subrepo/test/pull.t +99 -0
- data/vendor/git-subrepo/test/push-after-init.t +51 -0
- data/vendor/git-subrepo/test/push-force.t +56 -0
- data/vendor/git-subrepo/test/push-new-branch.t +61 -0
- data/vendor/git-subrepo/test/push-no-changes.t +29 -0
- data/vendor/git-subrepo/test/push-squash.t +56 -0
- data/vendor/git-subrepo/test/push.t +176 -0
- data/vendor/git-subrepo/test/reclone.t +45 -0
- data/vendor/git-subrepo/test/repo/bar/HEAD +1 -0
- data/vendor/git-subrepo/test/repo/bar/config +4 -0
- data/vendor/git-subrepo/test/repo/bar/objects/1f/0c4b264caed0126814a0ede851a1e0b4e16ae6 +0 -0
- data/vendor/git-subrepo/test/repo/bar/objects/87/46903fdb1b9c2101377880125917c2e05b4d69 +0 -0
- data/vendor/git-subrepo/test/repo/bar/objects/94/c86ffc745232d89f78c6f895e11e71272518db +0 -0
- data/vendor/git-subrepo/test/repo/bar/objects/c6/76c57b6576743fa56278527aa60ebd2e202a7c +0 -0
- data/vendor/git-subrepo/test/repo/bar/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
- data/vendor/git-subrepo/test/repo/bar/objects/f6/2a8ff3feadf39b0a98f1a86ec6d1eb33858ee9 +0 -0
- data/vendor/git-subrepo/test/repo/bar/refs/heads/master +1 -0
- data/vendor/git-subrepo/test/repo/bar/refs/tags/A +1 -0
- data/vendor/git-subrepo/test/repo/foo/HEAD +1 -0
- data/vendor/git-subrepo/test/repo/foo/config +4 -0
- data/vendor/git-subrepo/test/repo/foo/objects/a0/f4cdaaf533a936296cdebbed8206c3b9ededa8 +0 -0
- data/vendor/git-subrepo/test/repo/foo/objects/e2/1291a1ad392a9d4c51dd9586804f1467b28afd +0 -0
- data/vendor/git-subrepo/test/repo/foo/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
- data/vendor/git-subrepo/test/repo/foo/refs/heads/master +1 -0
- data/vendor/git-subrepo/test/repo/init/HEAD +1 -0
- data/vendor/git-subrepo/test/repo/init/config +5 -0
- data/vendor/git-subrepo/test/repo/init/objects/11/523f5dcf03b4c89b592dc8a3d0308f68da2386 +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/14/2addf8ec5f37334e837440122c62f2c68a29ad +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/32/5180321750a21cd7a4e7ecda319e557a4f6a09 +2 -0
- data/vendor/git-subrepo/test/repo/init/objects/3d/918c6901c02f43af5d31779dd5e1f9166aeb36 +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/3e/4cb596066dce63ba4d047abddb677389b65e19 +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/4b/6e53022e7a04f07887697e4f3d7c377fd9822b +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/58/931fc1bd559b59c41ea738fc7ad04f9ad01bd3 +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/5e/c0c28e1b806f25efdca18fcf7a74b49c3755bd +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/75/fa6584e748f57eff06eebdc55e9ac21d4fcbf2 +1 -0
- data/vendor/git-subrepo/test/repo/init/objects/80/2d5edbd5e1cb7fca82b5bd38e7c8a0a496fb20 +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/94/7b3d714c38791e95ad6f928b48c98bb8708acd +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/95/e1f2df3f4d5f3d7a60588c25a7ca8a913d3c2a +1 -0
- data/vendor/git-subrepo/test/repo/init/objects/b1/5f4a7666baf40d949548ead946a3370e273479 +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/c3/ee8978c4c5d84c3b7d00ba8e5906933d027882 +0 -0
- data/vendor/git-subrepo/test/repo/init/objects/c8/b0bffbc405ef3fad7354ff833fbec36d67ddfa +3 -0
- data/vendor/git-subrepo/test/repo/init/objects/dd/8bdb934ec848137f011fe423b185505c343626 +2 -0
- data/vendor/git-subrepo/test/repo/init/objects/e2/9be58c767cfeb27235c995d293a7d71aac0135 +2 -0
- data/vendor/git-subrepo/test/repo/init/objects/ee/1224401fc6aac595145fa727dcf6706ac8aec1 +1 -0
- data/vendor/git-subrepo/test/repo/init/objects/f1/cc1a657b2e805c400f5dcaaa76bd29c6178b1b +0 -0
- data/vendor/git-subrepo/test/repo/init/refs/heads/master +1 -0
- data/vendor/git-subrepo/test/setup +205 -0
- data/vendor/git-subrepo/test/status.t +68 -0
- data/vendor/git-subrepo/test/submodule.t +45 -0
- metadata +190 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
source test/setup
|
|
6
|
+
|
|
7
|
+
use Test::More
|
|
8
|
+
|
|
9
|
+
{
|
|
10
|
+
source lib/git-subrepo
|
|
11
|
+
pass 'source lib/git-subrepo'
|
|
12
|
+
|
|
13
|
+
source ext/bashplus/lib/bash+.bash
|
|
14
|
+
pass 'source ext/bashplus/lib/bash+.bash'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
done_testing 2
|
|
18
|
+
|
|
19
|
+
teardown
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
source test/setup
|
|
6
|
+
|
|
7
|
+
use Test::More
|
|
8
|
+
|
|
9
|
+
git clone $UPSTREAM/init $OWNER/init &>/dev/null
|
|
10
|
+
|
|
11
|
+
gitrepo=$OWNER/init/doc/.gitrepo
|
|
12
|
+
|
|
13
|
+
(
|
|
14
|
+
cd "$OWNER/init"
|
|
15
|
+
git subrepo init doc
|
|
16
|
+
) > /dev/null
|
|
17
|
+
|
|
18
|
+
# Test init/doc/.gitrepo file contents:
|
|
19
|
+
{
|
|
20
|
+
test-gitrepo-field "remote" "none"
|
|
21
|
+
test-gitrepo-field "branch" "master"
|
|
22
|
+
test-gitrepo-field "commit" ""
|
|
23
|
+
test-gitrepo-field "parent" ""
|
|
24
|
+
test-gitrepo-field "method" "merge"
|
|
25
|
+
test-gitrepo-field "cmdver" "`git subrepo --version`"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
is "$(
|
|
29
|
+
cd $OWNER/init
|
|
30
|
+
git subrepo config doc method rebase
|
|
31
|
+
)" \
|
|
32
|
+
"Subrepo 'doc' option 'method' set to 'rebase'."
|
|
33
|
+
|
|
34
|
+
{
|
|
35
|
+
test-gitrepo-field "remote" "none"
|
|
36
|
+
test-gitrepo-field "branch" "master"
|
|
37
|
+
test-gitrepo-field "commit" ""
|
|
38
|
+
test-gitrepo-field "parent" ""
|
|
39
|
+
test-gitrepo-field "method" "rebase"
|
|
40
|
+
test-gitrepo-field "cmdver" "`git subrepo --version`"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
is "$(
|
|
44
|
+
cd $OWNER/init
|
|
45
|
+
git subrepo config doc method
|
|
46
|
+
)" \
|
|
47
|
+
"Subrepo 'doc' option 'method' has value 'rebase'."
|
|
48
|
+
|
|
49
|
+
is "$(
|
|
50
|
+
cd $OWNER/init
|
|
51
|
+
catch git subrepo config doc branch new
|
|
52
|
+
)" \
|
|
53
|
+
"git-subrepo: This option is autogenerated, use '--force' to override."
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
done_testing
|
|
57
|
+
|
|
58
|
+
teardown
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
source test/setup
|
|
6
|
+
|
|
7
|
+
use Test::More
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export round=0
|
|
11
|
+
test_round() {
|
|
12
|
+
clone-foo-and-bar
|
|
13
|
+
|
|
14
|
+
round=$(( round + 1 ))
|
|
15
|
+
normalize_dir="$1"
|
|
16
|
+
normalize_dir="${normalize_dir#./}"
|
|
17
|
+
normalize_dir="${normalize_dir%/}"
|
|
18
|
+
while [[ $normalize_dir =~ (//+) ]]; do normalize_dir=${normalize_dir//${BASH_REMATCH[1]}/\/}; done
|
|
19
|
+
|
|
20
|
+
clone_output="$(
|
|
21
|
+
cd $OWNER/foo
|
|
22
|
+
git subrepo clone ../../../$UPSTREAM/bar -- "$normalize_dir"
|
|
23
|
+
)"
|
|
24
|
+
|
|
25
|
+
# Check output is correct:
|
|
26
|
+
is "$clone_output" \
|
|
27
|
+
"Subrepo '../../../tmp/upstream/bar' (master) cloned into '$normalize_dir'." \
|
|
28
|
+
'subrepo clone command output is correct'
|
|
29
|
+
|
|
30
|
+
test-exists "$OWNER/foo/$normalize_dir/"
|
|
31
|
+
|
|
32
|
+
(
|
|
33
|
+
cd $OWNER/bar
|
|
34
|
+
git pull
|
|
35
|
+
add-new-files Bar2-$round
|
|
36
|
+
git push
|
|
37
|
+
) &> /dev/null || die
|
|
38
|
+
|
|
39
|
+
# Do the pull and check output:
|
|
40
|
+
{
|
|
41
|
+
is "$(
|
|
42
|
+
cd $OWNER/foo
|
|
43
|
+
git subrepo pull -- "$normalize_dir"
|
|
44
|
+
)" \
|
|
45
|
+
"Subrepo '$normalize_dir' pulled from '../../../tmp/upstream/bar' (master)." \
|
|
46
|
+
'subrepo pull command output is correct'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
test-exists "$OWNER/foo/$normalize_dir/"
|
|
50
|
+
|
|
51
|
+
(
|
|
52
|
+
cd "$OWNER/foo/$normalize_dir"
|
|
53
|
+
git pull
|
|
54
|
+
add-new-files new-$round
|
|
55
|
+
git push
|
|
56
|
+
) &> /dev/null || die
|
|
57
|
+
|
|
58
|
+
# Do the push and check output:
|
|
59
|
+
{
|
|
60
|
+
is "$(
|
|
61
|
+
cd $OWNER/foo
|
|
62
|
+
git subrepo push -- "$normalize_dir"
|
|
63
|
+
)" \
|
|
64
|
+
"Subrepo '$normalize_dir' pushed to '../../../tmp/upstream/bar' (master)." \
|
|
65
|
+
'subrepo push command output is correct'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
test_round normal
|
|
70
|
+
test_round .dot
|
|
71
|
+
test_round ......dots
|
|
72
|
+
test_round 'spa ce'
|
|
73
|
+
test_round 'per%cent'
|
|
74
|
+
test_round 'back-sl\ash'
|
|
75
|
+
test_round 'end-with.lock'
|
|
76
|
+
test_round '@'
|
|
77
|
+
test_round '@{'
|
|
78
|
+
test_round '['
|
|
79
|
+
test_round '-begin-with-minus'
|
|
80
|
+
test_round 'tailing-slash/'
|
|
81
|
+
test_round 'tailing-dots...'
|
|
82
|
+
test_round 'special-char:^[?*'
|
|
83
|
+
test_round 'many////slashes'
|
|
84
|
+
test_round '_under_scores_'
|
|
85
|
+
|
|
86
|
+
test_round '.str%a\nge...'
|
|
87
|
+
test_round '~////......s:a^t?r a*n[g@{e.lock'
|
|
88
|
+
|
|
89
|
+
done_testing
|
|
90
|
+
|
|
91
|
+
teardown
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
source test/setup
|
|
6
|
+
|
|
7
|
+
use Test::More
|
|
8
|
+
export GIT_SUBREPO_TEST_ERRORS=true
|
|
9
|
+
|
|
10
|
+
note "Test all error message conditions in git-subrepo"
|
|
11
|
+
|
|
12
|
+
clone-foo-and-bar
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
is "$(
|
|
16
|
+
cd $OWNER/bar
|
|
17
|
+
git subrepo --quiet clone ../../../$UPSTREAM/foo
|
|
18
|
+
add-new-files foo/file
|
|
19
|
+
git subrepo --quiet branch foo
|
|
20
|
+
catch git subrepo branch foo
|
|
21
|
+
)" \
|
|
22
|
+
"git-subrepo: Branch 'subrepo/foo' already exists. Use '--force' to override." \
|
|
23
|
+
"Error OK: can't create a branch that exists"
|
|
24
|
+
|
|
25
|
+
(
|
|
26
|
+
cd $OWNER/bar
|
|
27
|
+
git subrepo --quiet clean foo
|
|
28
|
+
git reset --quiet --hard HEAD^
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
like "$(catch git subrepo clone --foo)" \
|
|
34
|
+
"error: unknown option \`foo" \
|
|
35
|
+
"Error OK: unknown command option"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
{
|
|
39
|
+
is "$(catch git subrepo main 1 2 3)" \
|
|
40
|
+
"git-subrepo: 'main' is not a command. See 'git subrepo help'." \
|
|
41
|
+
"Error OK: unknown command"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
{
|
|
45
|
+
is "$(catch git subrepo pull --update)" \
|
|
46
|
+
"git-subrepo: Can't use '--update' without '--branch' or '--remote'." \
|
|
47
|
+
"Error OK: --update requires --branch or --remote options"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
{
|
|
51
|
+
is "$(catch git subrepo clone --all)" \
|
|
52
|
+
"git-subrepo: Invalid option '--all' for 'clone'." \
|
|
53
|
+
"Error OK: Invalid option '--all' for 'clone'"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
{
|
|
57
|
+
like "$(
|
|
58
|
+
cd $OWNER/bar
|
|
59
|
+
catch git subrepo pull /home/user/bar/foo
|
|
60
|
+
)" \
|
|
61
|
+
"git-subrepo: The subdir '.*/home/user/bar/foo' should not be absolute path." \
|
|
62
|
+
"Error OK: check subdir is not absolute path"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
{
|
|
66
|
+
# XXX add 'commit' to cmds here when implemented:
|
|
67
|
+
for cmd in pull push fetch branch commit clean; do
|
|
68
|
+
is "$(
|
|
69
|
+
cd $OWNER/bar
|
|
70
|
+
catch git subrepo $cmd
|
|
71
|
+
)" \
|
|
72
|
+
"git-subrepo: Command '$cmd' requires arg 'subdir'." \
|
|
73
|
+
"Error OK: check that '$cmd' requires subdir"
|
|
74
|
+
done
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
{
|
|
78
|
+
is "$(
|
|
79
|
+
cd $OWNER/bar
|
|
80
|
+
catch git subrepo clone foo bar baz quux
|
|
81
|
+
)" \
|
|
82
|
+
"git-subrepo: Unknown argument(s) 'baz quux' for 'clone' command." \
|
|
83
|
+
"Error OK: extra arguments for clone"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
{
|
|
87
|
+
is "$(
|
|
88
|
+
cd $OWNER/bar
|
|
89
|
+
catch git subrepo clone .git
|
|
90
|
+
)" \
|
|
91
|
+
"git-subrepo: Can't determine subdir from '.git'." \
|
|
92
|
+
"Error OK: check error in subdir guess"
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
{
|
|
96
|
+
is "$(
|
|
97
|
+
cd $OWNER/bar
|
|
98
|
+
catch git subrepo pull lala
|
|
99
|
+
)" \
|
|
100
|
+
"git-subrepo: No 'lala/.gitrepo' file." \
|
|
101
|
+
"Error OK: check for valid subrepo subdir"
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
{
|
|
105
|
+
is "$(
|
|
106
|
+
cd $OWNER/bar
|
|
107
|
+
git checkout --quiet $(git rev-parse master)
|
|
108
|
+
catch git subrepo status
|
|
109
|
+
)" \
|
|
110
|
+
"git-subrepo: Must be on a branch to run this command." \
|
|
111
|
+
"Error OK: check repo is on a branch"
|
|
112
|
+
(
|
|
113
|
+
cd $OWNER/bar
|
|
114
|
+
git checkout --quiet master
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
{
|
|
119
|
+
is "$(
|
|
120
|
+
cd .git
|
|
121
|
+
catch git subrepo status
|
|
122
|
+
)" \
|
|
123
|
+
"git-subrepo: Can't 'subrepo status' outside a working tree." \
|
|
124
|
+
"Error OK: check inside working tree"
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
{
|
|
128
|
+
like "$(
|
|
129
|
+
cd $OWNER/bar
|
|
130
|
+
touch me
|
|
131
|
+
git add me
|
|
132
|
+
catch git subrepo clone ../../../$UPSTREAM/foo
|
|
133
|
+
)" \
|
|
134
|
+
"git-subrepo: Can't clone subrepo. Working tree has changes." \
|
|
135
|
+
"Error OK: check no working tree changes"
|
|
136
|
+
(
|
|
137
|
+
cd $OWNER/bar
|
|
138
|
+
git reset --quiet --hard
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
{
|
|
143
|
+
is "$(
|
|
144
|
+
cd lib
|
|
145
|
+
catch git subrepo status
|
|
146
|
+
)" \
|
|
147
|
+
"git-subrepo: Need to run subrepo command from top level directory of the repo." \
|
|
148
|
+
"Error OK: check cwd is at top level"
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
{
|
|
152
|
+
is "$(
|
|
153
|
+
cd $OWNER/bar
|
|
154
|
+
catch git subrepo clone dummy bard
|
|
155
|
+
)" \
|
|
156
|
+
"git-subrepo: The subdir 'bard' exists and is not empty." \
|
|
157
|
+
"Error OK: non-empty clone subdir target"
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
{
|
|
161
|
+
is "$(
|
|
162
|
+
cd $OWNER/bar
|
|
163
|
+
catch git subrepo clone dummy-repo
|
|
164
|
+
)" \
|
|
165
|
+
"git-subrepo: Command failed: 'git ls-remote dummy-repo'." \
|
|
166
|
+
"Error OK: clone non-repo"
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
done_testing
|
|
170
|
+
|
|
171
|
+
teardown
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
source test/setup
|
|
6
|
+
|
|
7
|
+
use Test::More
|
|
8
|
+
|
|
9
|
+
clone-foo-and-bar
|
|
10
|
+
|
|
11
|
+
subrepo-clone-bar-into-foo
|
|
12
|
+
|
|
13
|
+
(
|
|
14
|
+
cd $OWNER/bar
|
|
15
|
+
add-new-files Bar2
|
|
16
|
+
git tag -a CoolTag -m "Should stay in subrepo"
|
|
17
|
+
git push
|
|
18
|
+
) &> /dev/null || die
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# Fetch information
|
|
22
|
+
{
|
|
23
|
+
is "$(
|
|
24
|
+
cd $OWNER/foo
|
|
25
|
+
git subrepo fetch bar
|
|
26
|
+
)" \
|
|
27
|
+
"Fetched 'bar' from '../../../tmp/upstream/bar' (master)." \
|
|
28
|
+
'subrepo fetch command output is correct'
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
# Check that there is no tags fetched
|
|
32
|
+
{
|
|
33
|
+
is "$(
|
|
34
|
+
cd $OWNER/foo
|
|
35
|
+
git tag -l 'CoolTag'
|
|
36
|
+
)" \
|
|
37
|
+
"" \
|
|
38
|
+
'No tag is available'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
done_testing
|
|
42
|
+
|
|
43
|
+
teardown
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
source test/setup
|
|
6
|
+
|
|
7
|
+
use Test::More
|
|
8
|
+
|
|
9
|
+
clone-foo-and-bar
|
|
10
|
+
|
|
11
|
+
subrepo-clone-bar-into-foo
|
|
12
|
+
|
|
13
|
+
(
|
|
14
|
+
cd $OWNER/bar
|
|
15
|
+
add-new-files Bar2
|
|
16
|
+
git push
|
|
17
|
+
) &> /dev/null || die
|
|
18
|
+
|
|
19
|
+
(
|
|
20
|
+
cd $OWNER/foo
|
|
21
|
+
echo ".*" >> .gitignore
|
|
22
|
+
git add .gitignore
|
|
23
|
+
git commit -m "Add gitignore"
|
|
24
|
+
git push
|
|
25
|
+
) &> /dev/null || die
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# Do the pull and check output:
|
|
30
|
+
{
|
|
31
|
+
is "$(
|
|
32
|
+
cd $OWNER/foo
|
|
33
|
+
git subrepo pull bar
|
|
34
|
+
)" \
|
|
35
|
+
"Subrepo 'bar' pulled from '../../../tmp/upstream/bar' (master)." \
|
|
36
|
+
'subrepo pull command output is correct'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# Test subrepo file content:
|
|
40
|
+
gitrepo=$OWNER/foo/bar/.gitrepo
|
|
41
|
+
{
|
|
42
|
+
test-exists \
|
|
43
|
+
"$OWNER/foo/bar/Bar2" \
|
|
44
|
+
"$gitrepo"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# Test foo/bar/.gitrepo file contents:
|
|
48
|
+
{
|
|
49
|
+
foo_pull_commit="$(cd $OWNER/foo; git rev-parse HEAD^)"
|
|
50
|
+
bar_head_commit="$(cd $OWNER/bar; git rev-parse HEAD)"
|
|
51
|
+
test-gitrepo-comment-block
|
|
52
|
+
test-gitrepo-field "remote" "../../../$UPSTREAM/bar"
|
|
53
|
+
test-gitrepo-field "branch" "master"
|
|
54
|
+
test-gitrepo-field "commit" "$bar_head_commit"
|
|
55
|
+
test-gitrepo-field "parent" "$foo_pull_commit"
|
|
56
|
+
test-gitrepo-field "cmdver" "`git subrepo --version`"
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
done_testing
|
|
60
|
+
|
|
61
|
+
teardown
|