eac_git 0.1.0 → 0.2.0

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.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/lib/eac_git/executables.rb +24 -4
  3. data/lib/eac_git/rspec.rb +17 -0
  4. data/lib/eac_git/version.rb +1 -1
  5. data/vendor/git-subrepo/Changes +110 -0
  6. data/vendor/git-subrepo/Intro.pod +509 -0
  7. data/vendor/git-subrepo/License +21 -0
  8. data/vendor/git-subrepo/Makefile +82 -0
  9. data/vendor/git-subrepo/Meta +28 -0
  10. data/vendor/git-subrepo/ReadMe.pod +698 -0
  11. data/vendor/git-subrepo/doc/comparison.swim +35 -0
  12. data/vendor/git-subrepo/doc/git-subrepo.swim +608 -0
  13. data/vendor/git-subrepo/doc/intro-to-subrepo.swim +387 -0
  14. data/vendor/git-subrepo/ext/bashplus/Changes +15 -0
  15. data/vendor/git-subrepo/ext/bashplus/License +21 -0
  16. data/vendor/git-subrepo/ext/bashplus/Makefile +45 -0
  17. data/vendor/git-subrepo/ext/bashplus/Meta +28 -0
  18. data/vendor/git-subrepo/ext/bashplus/ReadMe.pod +77 -0
  19. data/vendor/git-subrepo/ext/bashplus/bin/bash+ +43 -0
  20. data/vendor/git-subrepo/ext/bashplus/doc/bash+.swim +61 -0
  21. data/vendor/git-subrepo/ext/bashplus/lib/bash+.bash +92 -0
  22. data/vendor/git-subrepo/ext/bashplus/man/man1/bash+.1 +134 -0
  23. data/vendor/git-subrepo/ext/bashplus/man/man3/bash+.3 +134 -0
  24. data/vendor/git-subrepo/ext/bashplus/test/base.t +12 -0
  25. data/vendor/git-subrepo/ext/bashplus/test/fcopy.t +22 -0
  26. data/vendor/git-subrepo/ext/bashplus/test/lib/foo/bar.bash +3 -0
  27. data/vendor/git-subrepo/ext/bashplus/test/lib/foo/foo.bash +3 -0
  28. data/vendor/git-subrepo/ext/bashplus/test/source-bash+-std.t +18 -0
  29. data/vendor/git-subrepo/ext/bashplus/test/source-bash+.t +23 -0
  30. data/vendor/git-subrepo/ext/bashplus/test/test.bash +70 -0
  31. data/vendor/git-subrepo/ext/bashplus/test/use.t +19 -0
  32. data/vendor/git-subrepo/ext/test-more-bash/Changes +15 -0
  33. data/vendor/git-subrepo/ext/test-more-bash/License +21 -0
  34. data/vendor/git-subrepo/ext/test-more-bash/Makefile +20 -0
  35. data/vendor/git-subrepo/ext/test-more-bash/Meta +30 -0
  36. data/vendor/git-subrepo/ext/test-more-bash/ReadMe.pod +115 -0
  37. data/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim +89 -0
  38. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Changes +15 -0
  39. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/License +21 -0
  40. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Makefile +45 -0
  41. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Meta +28 -0
  42. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/ReadMe.pod +77 -0
  43. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ +43 -0
  44. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/doc/bash+.swim +61 -0
  45. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash +92 -0
  46. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man1/bash+.1 +134 -0
  47. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man3/bash+.3 +134 -0
  48. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/base.t +12 -0
  49. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/fcopy.t +22 -0
  50. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/lib/foo/bar.bash +3 -0
  51. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/lib/foo/foo.bash +3 -0
  52. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t +18 -0
  53. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+.t +23 -0
  54. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/test.bash +70 -0
  55. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/use.t +19 -0
  56. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Changes +15 -0
  57. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/License +21 -0
  58. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Makefile +37 -0
  59. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Meta +28 -0
  60. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod +66 -0
  61. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim +48 -0
  62. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash +153 -0
  63. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/man/man3/test-tap.3 +119 -0
  64. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t +13 -0
  65. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/done.t +10 -0
  66. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail.t +20 -0
  67. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t +15 -0
  68. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/helper.bash +9 -0
  69. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/pass.t +9 -0
  70. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/plan.t +10 -0
  71. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/skip_all.t +20 -0
  72. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/tap.t +13 -0
  73. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/bail.t +14 -0
  74. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/fail.t +7 -0
  75. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/fail_fast.t +12 -0
  76. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-init.t +8 -0
  77. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-plan.t +9 -0
  78. data/vendor/git-subrepo/ext/test-more-bash/lib/test/more.bash +95 -0
  79. data/vendor/git-subrepo/ext/test-more-bash/man/man3/test-more.3 +173 -0
  80. data/vendor/git-subrepo/ext/test-more-bash/test/fail.t +20 -0
  81. data/vendor/git-subrepo/ext/test-more-bash/test/more.t +20 -0
  82. data/vendor/git-subrepo/ext/test-more-bash/test/pass.t +9 -0
  83. data/vendor/git-subrepo/ext/test-more-bash/test/setup +8 -0
  84. data/vendor/git-subrepo/ext/test-more-bash/test/skip_all.t +11 -0
  85. data/vendor/git-subrepo/ext/test-more-bash/test/test/fail1.t +12 -0
  86. data/vendor/git-subrepo/ext/test-more-bash/test/test/skip_all.t +10 -0
  87. data/vendor/git-subrepo/lib/git-subrepo +1901 -0
  88. data/vendor/git-subrepo/lib/git-subrepo.d/bash+.bash +1 -0
  89. data/vendor/git-subrepo/lib/git-subrepo.d/help-functions.bash +339 -0
  90. data/vendor/git-subrepo/man/man1/git-subrepo.1 +743 -0
  91. data/vendor/git-subrepo/note/0.4.0 +12 -0
  92. data/vendor/git-subrepo/note/AllGitCmds +148 -0
  93. data/vendor/git-subrepo/note/Cases +32 -0
  94. data/vendor/git-subrepo/note/Commands +33 -0
  95. data/vendor/git-subrepo/note/Dags +199 -0
  96. data/vendor/git-subrepo/note/Gists +7 -0
  97. data/vendor/git-subrepo/note/Links +25 -0
  98. data/vendor/git-subrepo/note/Plugins +10 -0
  99. data/vendor/git-subrepo/note/Spec +39 -0
  100. data/vendor/git-subrepo/note/Story1 +57 -0
  101. data/vendor/git-subrepo/note/ToDo +55 -0
  102. data/vendor/git-subrepo/note/design.swim +137 -0
  103. data/vendor/git-subrepo/note/design2.swim +85 -0
  104. data/vendor/git-subrepo/note/init-test +38 -0
  105. data/vendor/git-subrepo/note/pull-dance.txt +18 -0
  106. data/vendor/git-subrepo/note/recreate-rebase-conflict.sh +56 -0
  107. data/vendor/git-subrepo/note/subtree-rebase-fail-example/test.bash +29 -0
  108. data/vendor/git-subrepo/note/test-subrepo-push.sh +69 -0
  109. data/vendor/git-subrepo/note/test.sh +58 -0
  110. data/vendor/git-subrepo/pkg/bin/generate-completion.pl +210 -0
  111. data/vendor/git-subrepo/pkg/bin/generate-help-functions.pl +89 -0
  112. data/vendor/git-subrepo/share/completion.bash +42 -0
  113. data/vendor/git-subrepo/share/enable-completion.sh +50 -0
  114. data/vendor/git-subrepo/share/git-completion.bash +2738 -0
  115. data/vendor/git-subrepo/share/zsh-completion/_git-subrepo +81 -0
  116. data/vendor/git-subrepo/test/branch-all.t +41 -0
  117. data/vendor/git-subrepo/test/branch-rev-list-one-path.t +43 -0
  118. data/vendor/git-subrepo/test/branch-rev-list.t +47 -0
  119. data/vendor/git-subrepo/test/branch.t +52 -0
  120. data/vendor/git-subrepo/test/clean.t +43 -0
  121. data/vendor/git-subrepo/test/clone-annotated-tag.t +45 -0
  122. data/vendor/git-subrepo/test/clone.t +107 -0
  123. data/vendor/git-subrepo/test/compile.t +19 -0
  124. data/vendor/git-subrepo/test/config.t +58 -0
  125. data/vendor/git-subrepo/test/encode.t +91 -0
  126. data/vendor/git-subrepo/test/error.t +171 -0
  127. data/vendor/git-subrepo/test/fetch.t +43 -0
  128. data/vendor/git-subrepo/test/gitignore.t +61 -0
  129. data/vendor/git-subrepo/test/init.t +64 -0
  130. data/vendor/git-subrepo/test/issue29.t +98 -0
  131. data/vendor/git-subrepo/test/issue95.t +98 -0
  132. data/vendor/git-subrepo/test/issue96.t +96 -0
  133. data/vendor/git-subrepo/test/pull-all.t +38 -0
  134. data/vendor/git-subrepo/test/pull-merge.t +113 -0
  135. data/vendor/git-subrepo/test/pull-message.t +88 -0
  136. data/vendor/git-subrepo/test/pull-new-branch.t +58 -0
  137. data/vendor/git-subrepo/test/pull-ours.t +90 -0
  138. data/vendor/git-subrepo/test/pull-theirs.t +82 -0
  139. data/vendor/git-subrepo/test/pull-twice.t +44 -0
  140. data/vendor/git-subrepo/test/pull-worktree.t +40 -0
  141. data/vendor/git-subrepo/test/pull.t +99 -0
  142. data/vendor/git-subrepo/test/push-after-init.t +51 -0
  143. data/vendor/git-subrepo/test/push-force.t +56 -0
  144. data/vendor/git-subrepo/test/push-new-branch.t +61 -0
  145. data/vendor/git-subrepo/test/push-no-changes.t +29 -0
  146. data/vendor/git-subrepo/test/push-squash.t +56 -0
  147. data/vendor/git-subrepo/test/push.t +176 -0
  148. data/vendor/git-subrepo/test/reclone.t +45 -0
  149. data/vendor/git-subrepo/test/repo/bar/HEAD +1 -0
  150. data/vendor/git-subrepo/test/repo/bar/config +4 -0
  151. data/vendor/git-subrepo/test/repo/bar/objects/1f/0c4b264caed0126814a0ede851a1e0b4e16ae6 +0 -0
  152. data/vendor/git-subrepo/test/repo/bar/objects/87/46903fdb1b9c2101377880125917c2e05b4d69 +0 -0
  153. data/vendor/git-subrepo/test/repo/bar/objects/94/c86ffc745232d89f78c6f895e11e71272518db +0 -0
  154. data/vendor/git-subrepo/test/repo/bar/objects/c6/76c57b6576743fa56278527aa60ebd2e202a7c +0 -0
  155. data/vendor/git-subrepo/test/repo/bar/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
  156. data/vendor/git-subrepo/test/repo/bar/objects/f6/2a8ff3feadf39b0a98f1a86ec6d1eb33858ee9 +0 -0
  157. data/vendor/git-subrepo/test/repo/bar/refs/heads/master +1 -0
  158. data/vendor/git-subrepo/test/repo/bar/refs/tags/A +1 -0
  159. data/vendor/git-subrepo/test/repo/foo/HEAD +1 -0
  160. data/vendor/git-subrepo/test/repo/foo/config +4 -0
  161. data/vendor/git-subrepo/test/repo/foo/objects/a0/f4cdaaf533a936296cdebbed8206c3b9ededa8 +0 -0
  162. data/vendor/git-subrepo/test/repo/foo/objects/e2/1291a1ad392a9d4c51dd9586804f1467b28afd +0 -0
  163. data/vendor/git-subrepo/test/repo/foo/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
  164. data/vendor/git-subrepo/test/repo/foo/refs/heads/master +1 -0
  165. data/vendor/git-subrepo/test/repo/init/HEAD +1 -0
  166. data/vendor/git-subrepo/test/repo/init/config +5 -0
  167. data/vendor/git-subrepo/test/repo/init/objects/11/523f5dcf03b4c89b592dc8a3d0308f68da2386 +0 -0
  168. data/vendor/git-subrepo/test/repo/init/objects/14/2addf8ec5f37334e837440122c62f2c68a29ad +0 -0
  169. data/vendor/git-subrepo/test/repo/init/objects/32/5180321750a21cd7a4e7ecda319e557a4f6a09 +2 -0
  170. data/vendor/git-subrepo/test/repo/init/objects/3d/918c6901c02f43af5d31779dd5e1f9166aeb36 +0 -0
  171. data/vendor/git-subrepo/test/repo/init/objects/3e/4cb596066dce63ba4d047abddb677389b65e19 +0 -0
  172. data/vendor/git-subrepo/test/repo/init/objects/4b/6e53022e7a04f07887697e4f3d7c377fd9822b +0 -0
  173. data/vendor/git-subrepo/test/repo/init/objects/58/931fc1bd559b59c41ea738fc7ad04f9ad01bd3 +0 -0
  174. data/vendor/git-subrepo/test/repo/init/objects/5e/c0c28e1b806f25efdca18fcf7a74b49c3755bd +0 -0
  175. data/vendor/git-subrepo/test/repo/init/objects/75/fa6584e748f57eff06eebdc55e9ac21d4fcbf2 +1 -0
  176. data/vendor/git-subrepo/test/repo/init/objects/80/2d5edbd5e1cb7fca82b5bd38e7c8a0a496fb20 +0 -0
  177. data/vendor/git-subrepo/test/repo/init/objects/94/7b3d714c38791e95ad6f928b48c98bb8708acd +0 -0
  178. data/vendor/git-subrepo/test/repo/init/objects/95/e1f2df3f4d5f3d7a60588c25a7ca8a913d3c2a +1 -0
  179. data/vendor/git-subrepo/test/repo/init/objects/b1/5f4a7666baf40d949548ead946a3370e273479 +0 -0
  180. data/vendor/git-subrepo/test/repo/init/objects/c3/ee8978c4c5d84c3b7d00ba8e5906933d027882 +0 -0
  181. data/vendor/git-subrepo/test/repo/init/objects/c8/b0bffbc405ef3fad7354ff833fbec36d67ddfa +3 -0
  182. data/vendor/git-subrepo/test/repo/init/objects/dd/8bdb934ec848137f011fe423b185505c343626 +2 -0
  183. data/vendor/git-subrepo/test/repo/init/objects/e2/9be58c767cfeb27235c995d293a7d71aac0135 +2 -0
  184. data/vendor/git-subrepo/test/repo/init/objects/ee/1224401fc6aac595145fa727dcf6706ac8aec1 +1 -0
  185. data/vendor/git-subrepo/test/repo/init/objects/f1/cc1a657b2e805c400f5dcaaa76bd29c6178b1b +0 -0
  186. data/vendor/git-subrepo/test/repo/init/refs/heads/master +1 -0
  187. data/vendor/git-subrepo/test/setup +205 -0
  188. data/vendor/git-subrepo/test/status.t +68 -0
  189. data/vendor/git-subrepo/test/submodule.t +45 -0
  190. metadata +188 -2
@@ -0,0 +1,88 @@
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
+ # Do the pull and check output, use -m:
21
+ {
22
+ is "$(
23
+ cd $OWNER/foo
24
+ git subrepo pull -m 'Hello World' bar
25
+ )" \
26
+ "Subrepo 'bar' pulled from '../../../tmp/upstream/bar' (master)." \
27
+ 'subrepo pull command output is correct'
28
+ }
29
+
30
+ # Check -m commit messages
31
+ {
32
+ foo_new_commit_message="$(cd $OWNER/foo; git log --format=%B -n 1)"
33
+ like "$foo_new_commit_message" \
34
+ "Hello World" \
35
+ "subrepo pull commit message"
36
+ }
37
+
38
+ (
39
+ cd $OWNER/bar
40
+ add-new-files Bar3
41
+ git push
42
+ ) &> /dev/null || die
43
+
44
+ # Do the pull and check output, use -e:
45
+ {
46
+ is "$(
47
+ cd $OWNER/foo
48
+ GIT_EDITOR='echo cowabunga >' git subrepo pull -e bar
49
+ )" \
50
+ "Subrepo 'bar' pulled from '../../../tmp/upstream/bar' (master)." \
51
+ 'subrepo pull command output is correct'
52
+ }
53
+
54
+ # Check -e commit messages
55
+ {
56
+ foo_new_commit_message="$(cd $OWNER/foo; git log --format=%B -n 1)"
57
+ like "$foo_new_commit_message" \
58
+ "cowabunga" \
59
+ "subrepo pull edit commit message"
60
+ }
61
+
62
+ (
63
+ cd $OWNER/bar
64
+ add-new-files Bar4
65
+ git push
66
+ ) &> /dev/null || die
67
+
68
+ # Do the pull and check output, use -e and -m:
69
+ {
70
+ is "$(
71
+ cd $OWNER/foo
72
+ GIT_EDITOR=true git subrepo pull -e -m original bar
73
+ )" \
74
+ "Subrepo 'bar' pulled from '../../../tmp/upstream/bar' (master)." \
75
+ 'subrepo pull command output is correct'
76
+ }
77
+
78
+ # Check -e commit messages
79
+ {
80
+ foo_new_commit_message="$(cd $OWNER/foo; git log --format=%B -n 1)"
81
+ like "$foo_new_commit_message" \
82
+ "original" \
83
+ "subrepo pull edit and message commit message"
84
+ }
85
+
86
+ done_testing
87
+
88
+ teardown
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env bash
2
+
3
+ source test/setup
4
+
5
+ use Test::More
6
+
7
+ clone-foo-and-bar
8
+
9
+ subrepo-clone-bar-into-foo
10
+
11
+ (
12
+ cd "$OWNER/bar"
13
+ git checkout -b branch1
14
+ git push --set-upstream origin branch1
15
+ ) &> /dev/null || die
16
+
17
+ # Test subrepo file content:
18
+ gitrepo=$OWNER/foo/bar/.gitrepo
19
+
20
+ {
21
+ foo_pull_commit=$(cd "$OWNER/foo"; git rev-parse HEAD^)
22
+ bar_head_commit=$(cd "$OWNER/bar"; git rev-parse HEAD)
23
+ test-gitrepo-comment-block
24
+ test-gitrepo-field remote "../../../$UPSTREAM/bar"
25
+ test-gitrepo-field branch master
26
+ test-gitrepo-field commit "$bar_head_commit"
27
+ test-gitrepo-field parent "$foo_pull_commit"
28
+ test-gitrepo-field cmdver "$(git subrepo --version)"
29
+ }
30
+
31
+ (
32
+ cd "$OWNER/foo"
33
+ git subrepo pull bar -b branch1 -u
34
+ ) &> /dev/null || die
35
+
36
+ {
37
+ foo_pull_commit=$(cd "$OWNER/foo"; git rev-parse HEAD^)
38
+ bar_head_commit=$(cd "$OWNER/bar"; git rev-parse HEAD)
39
+ test-gitrepo-comment-block
40
+ test-gitrepo-field remote "../../../$UPSTREAM/bar"
41
+ test-gitrepo-field branch branch1
42
+ test-gitrepo-field commit "$bar_head_commit"
43
+ test-gitrepo-field parent "$foo_pull_commit"
44
+ test-gitrepo-field cmdver "$(git subrepo --version)"
45
+ }
46
+
47
+ {
48
+ is "$(
49
+ cd $OWNER/foo
50
+ git subrepo pull bar
51
+ )" \
52
+ "Subrepo 'bar' is up to date." \
53
+ 'subrepo detects that we dont need to pull'
54
+ }
55
+
56
+ done_testing
57
+
58
+ teardown
@@ -0,0 +1,90 @@
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
+ note "Pull - Conflict - Use ours - Push"
14
+
15
+ #
16
+ # When you perform rebase ours/theirs are reversed, so this test case will
17
+ # test using local change (ours) although in the step below
18
+ # we actually use git checkout --theirs to accomplish this
19
+ #
20
+
21
+ (
22
+ cd $OWNER/bar
23
+ add-new-files Bar2
24
+ git push
25
+ ) &> /dev/null || die
26
+
27
+ (
28
+ cd $OWNER/foo
29
+ git subrepo pull bar
30
+ modify-files-ex bar/Bar2
31
+ cat bar/Bar2
32
+ git push
33
+ ) &> /dev/null || die
34
+
35
+ (
36
+ cd $OWNER/bar
37
+ modify-files-ex Bar2
38
+ git push
39
+ ) &> /dev/null || die
40
+
41
+ before="$(date -r $OWNER/foo/Foo '+%s')"
42
+
43
+ (
44
+ cd $OWNER/foo
45
+ git subrepo pull bar || {
46
+ cd .git/tmp/subrepo/bar
47
+ git checkout --ours Bar2
48
+ git add Bar2
49
+ git commit --file ../../../../.git/worktrees/bar/MERGE_MSG
50
+ cd ../../../..
51
+ git subrepo commit bar
52
+ git subrepo clean bar
53
+ }
54
+ ) &> /dev/null || die
55
+
56
+ sleep 1
57
+ after="$(date -r $OWNER/foo/Foo '+%s')"
58
+
59
+ is "$before" "$after" \
60
+ "No modification on Foo"
61
+
62
+ test-exists \
63
+ "$OWNER/foo/bar/Bar2" \
64
+ "$OWNER/bar/Bar2" \
65
+
66
+ is "$(cat $OWNER/foo/bar/Bar2)" \
67
+ "new file Bar2"$'\n'"bar/Bar2" \
68
+ "The readme file in the mainrepo is ours"
69
+
70
+ (
71
+ cd $OWNER/foo
72
+ git subrepo push bar
73
+ ) &> /dev/null || die
74
+
75
+ (
76
+ cd $OWNER/bar
77
+ git pull
78
+ ) &> /dev/null || die
79
+
80
+ test-exists \
81
+ "$OWNER/foo/bar/Bar2" \
82
+ "$OWNER/bar/Bar2" \
83
+
84
+ is "$(cat $OWNER/bar/Bar2)" \
85
+ "new file Bar2"$'\n'"bar/Bar2" \
86
+ "The readme file in the subrepo is ours"
87
+
88
+ done_testing
89
+
90
+ teardown
@@ -0,0 +1,82 @@
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
+ note "Pull - Conflict - Use theirs - Push"
14
+
15
+ #
16
+ # When you perform rebase ours/theirs are reversed, so this test case will
17
+ # test using the subrepo change (theirs) although in the step below
18
+ # we actually use git checkout --ours to accomplish this
19
+ #
20
+
21
+ (
22
+ cd $OWNER/bar
23
+ add-new-files Bar2
24
+ git push
25
+ ) &> /dev/null || die
26
+
27
+ (
28
+ cd $OWNER/foo
29
+ git subrepo pull bar
30
+ modify-files-ex bar/Bar2
31
+ git push
32
+ ) &> /dev/null || die
33
+
34
+ (
35
+ cd $OWNER/bar
36
+ modify-files-ex Bar2
37
+ git push
38
+ ) &> /dev/null || die
39
+
40
+ (
41
+ cd $OWNER/foo
42
+ git subrepo pull bar || {
43
+ cd .git/tmp/subrepo/bar
44
+ git checkout --theirs Bar2
45
+ git add Bar2
46
+ git commit --file ../../../../.git/worktrees/bar/MERGE_MSG
47
+ cd ../../../..
48
+ git subrepo commit bar
49
+ git subrepo clean bar
50
+ }
51
+ ) &> /dev/null || die
52
+
53
+ test-exists \
54
+ "$OWNER/foo/bar/Bar2" \
55
+ "$OWNER/bar/Bar2" \
56
+
57
+ is "$(cat $OWNER/foo/bar/Bar2)" \
58
+ "new file Bar2"$'\n'"Bar2" \
59
+ "The readme file in the mainrepo is theirs"
60
+
61
+ (
62
+ cd $OWNER/foo
63
+ cat bar/Bar2
64
+ git subrepo push bar
65
+ ) &> /dev/null || die
66
+
67
+ (
68
+ cd $OWNER/bar
69
+ git pull
70
+ ) &> /dev/null || die
71
+
72
+ test-exists \
73
+ "$OWNER/foo/bar/Bar2" \
74
+ "$OWNER/bar/Bar2" \
75
+
76
+ is "$(cat $OWNER/bar/Bar2)" \
77
+ "new file Bar2"$'\n'"Bar2" \
78
+ "The readme file in the subrepo is theirs"
79
+
80
+ done_testing
81
+
82
+ teardown
@@ -0,0 +1,44 @@
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
+ add-new-files bar/Foo2
22
+ git push
23
+ git subrepo pull bar
24
+ ) &> /dev/null || die
25
+
26
+ (
27
+ cd $OWNER/bar
28
+ add-new-files Bar3
29
+ git push
30
+ ) &> /dev/null || die
31
+
32
+ (
33
+ cd $OWNER/foo
34
+ git subrepo pull bar
35
+ ) &> /dev/null || die
36
+
37
+ test-exists \
38
+ "$OWNER/foo/bar/Bar2" \
39
+ "$OWNER/foo/bar/Bar3" \
40
+ "$OWNER/foo/bar/Foo2" \
41
+
42
+ done_testing
43
+
44
+ teardown
@@ -0,0 +1,40 @@
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
+ (
12
+ cd $OWNER/foo
13
+ git subrepo clone ../bar bar
14
+ git worktree add -b test ../wt
15
+ ) &> /dev/null || die
16
+
17
+ (
18
+ cd $OWNER/bar
19
+ modify-files Bar
20
+ ) &> /dev/null || die
21
+
22
+ (
23
+ cd $OWNER/wt
24
+ git subrepo pull --all
25
+ ) &> /dev/null || die
26
+
27
+ (
28
+ cd $OWNER/foo
29
+ git merge test
30
+ ) &> /dev/null || die
31
+
32
+ {
33
+ is "$(cat $OWNER/foo/bar/Bar)" \
34
+ "a new line" \
35
+ 'bar/Bar content correct'
36
+ }
37
+
38
+ done_testing
39
+
40
+ teardown
@@ -0,0 +1,99 @@
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
+ # Do the pull and check output:
21
+ {
22
+ is "$(
23
+ cd $OWNER/foo
24
+ git subrepo pull bar
25
+ )" \
26
+ "Subrepo 'bar' pulled from '../../../tmp/upstream/bar' (master)." \
27
+ 'subrepo pull command output is correct'
28
+ }
29
+
30
+ # Test subrepo file content:
31
+ gitrepo=$OWNER/foo/bar/.gitrepo
32
+ {
33
+ test-exists \
34
+ "$OWNER/foo/bar/Bar2" \
35
+ "$gitrepo"
36
+ }
37
+
38
+ # Test foo/bar/.gitrepo file contents:
39
+ {
40
+ foo_pull_commit="$(cd $OWNER/foo; git rev-parse HEAD^)"
41
+ bar_head_commit="$(cd $OWNER/bar; git rev-parse HEAD)"
42
+ test-gitrepo-comment-block
43
+ test-gitrepo-field "remote" "../../../$UPSTREAM/bar"
44
+ test-gitrepo-field "branch" "master"
45
+ test-gitrepo-field "commit" "$bar_head_commit"
46
+ test-gitrepo-field "parent" "$foo_pull_commit"
47
+ test-gitrepo-field "cmdver" "`git subrepo --version`"
48
+ }
49
+
50
+ # Check commit messages
51
+ {
52
+ foo_new_commit_message="$(cd $OWNER/foo; git log --format=%B -n 1)"
53
+ like "$foo_new_commit_message" \
54
+ "git subrepo pull bar" \
55
+ "Subrepo pull commit message OK"
56
+ bar_commit_short="$(git rev-parse --short $bar_head_commit)"
57
+ like "$foo_new_commit_message" \
58
+ 'merged: \"'$bar_commit_short \
59
+ "Pull commit contains merged"
60
+ }
61
+
62
+ # Check that we detect that we don't need to pull
63
+ {
64
+ is "$(
65
+ cd $OWNER/foo
66
+ git subrepo pull bar
67
+ )" \
68
+ "Subrepo 'bar' is up to date." \
69
+ 'subrepo detects that we dont need to pull'
70
+ }
71
+
72
+ # Test pull if we have rebased the original subrepo so that our clone
73
+ # commit is no longer present in the history
74
+ (
75
+ cd $OWNER/bar
76
+ git reset --hard master^^
77
+ add-new-files Bar3
78
+ git push --force
79
+ ) &> /dev/null || die
80
+
81
+ {
82
+ test-exists \
83
+ !"$OWNER/foo/pull_failed"
84
+ }
85
+
86
+ (
87
+ cd $OWNER/foo
88
+ git subrepo pull bar || touch pull_failed
89
+ ) &> /dev/null || die
90
+
91
+ # We check that the control file was created
92
+ {
93
+ test-exists \
94
+ "$OWNER/foo/pull_failed"
95
+ }
96
+
97
+ done_testing # 9
98
+
99
+ teardown