eac_git 0.18.1 → 0.19.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 (146) hide show
  1. checksums.yaml +4 -4
  2. data/lib/eac_git/local/changed_file.rb +2 -2
  3. data/lib/eac_git/local/commit/diff_tree_line.rb +1 -1
  4. data/lib/eac_git/local/remote.rb +32 -8
  5. data/lib/eac_git/local/subrepo/config.rb +2 -0
  6. data/lib/eac_git/local.rb +2 -2
  7. data/lib/eac_git/remote_like/ls_result.rb +1 -1
  8. data/lib/eac_git/remote_like.rb +0 -1
  9. data/lib/eac_git/rspec/stubbed_git_local_repo.rb +0 -2
  10. data/lib/eac_git/rspec.rb +0 -1
  11. data/lib/eac_git/version.rb +1 -1
  12. data/lib/eac_git.rb +0 -2
  13. data/vendor/git-subrepo/.fish.rc +20 -0
  14. data/vendor/git-subrepo/.gitattributes +1 -0
  15. data/vendor/git-subrepo/.github/workflows/test.yml +29 -0
  16. data/vendor/git-subrepo/.gitignore +1 -0
  17. data/vendor/git-subrepo/.gitrepo +7 -0
  18. data/vendor/git-subrepo/.rc +32 -0
  19. data/vendor/git-subrepo/Changes +66 -0
  20. data/vendor/git-subrepo/Intro.pod +2 -5
  21. data/vendor/git-subrepo/Makefile +45 -5
  22. data/vendor/git-subrepo/Meta +2 -2
  23. data/vendor/git-subrepo/ReadMe.pod +26 -31
  24. data/vendor/git-subrepo/doc/git-subrepo.swim +22 -18
  25. data/vendor/git-subrepo/doc/intro-to-subrepo.swim +2 -4
  26. data/vendor/git-subrepo/ext/bashplus/.gitrepo +12 -0
  27. data/vendor/git-subrepo/ext/bashplus/.travis.yml +6 -0
  28. data/vendor/git-subrepo/ext/bashplus/Changes +19 -0
  29. data/vendor/git-subrepo/ext/bashplus/License +1 -1
  30. data/vendor/git-subrepo/ext/bashplus/Makefile +25 -0
  31. data/vendor/git-subrepo/ext/bashplus/Meta +4 -4
  32. data/vendor/git-subrepo/ext/bashplus/ReadMe.pod +2 -2
  33. data/vendor/git-subrepo/ext/bashplus/bin/bash+ +8 -7
  34. data/vendor/git-subrepo/ext/bashplus/doc/bash+.swim +1 -1
  35. data/vendor/git-subrepo/ext/bashplus/lib/bash+.bash +85 -38
  36. data/vendor/git-subrepo/ext/bashplus/man/man1/bash+.1 +8 -8
  37. data/vendor/git-subrepo/ext/bashplus/man/man3/bash+.3 +8 -8
  38. data/vendor/git-subrepo/ext/bashplus/test/base.t +4 -5
  39. data/vendor/git-subrepo/ext/bashplus/test/die.t +16 -0
  40. data/vendor/git-subrepo/ext/bashplus/test/fcopy.t +2 -3
  41. data/vendor/git-subrepo/ext/bashplus/test/{test.bash → setup} +18 -8
  42. data/vendor/git-subrepo/ext/bashplus/test/shellcheck.t +37 -0
  43. data/vendor/git-subrepo/ext/bashplus/test/source-bash+-std.t +10 -11
  44. data/vendor/git-subrepo/ext/bashplus/test/source-bash+.t +10 -11
  45. data/vendor/git-subrepo/ext/bashplus/test/use.t +8 -5
  46. data/vendor/git-subrepo/ext/bashplus/test/version-check.t +23 -0
  47. data/vendor/git-subrepo/ext/test-more-bash/.gitrepo +12 -0
  48. data/vendor/git-subrepo/ext/test-more-bash/.travis.yml +6 -0
  49. data/vendor/git-subrepo/ext/test-more-bash/Changes +11 -0
  50. data/vendor/git-subrepo/ext/test-more-bash/License +1 -1
  51. data/vendor/git-subrepo/ext/test-more-bash/Makefile +25 -0
  52. data/vendor/git-subrepo/ext/test-more-bash/Meta +5 -5
  53. data/vendor/git-subrepo/ext/test-more-bash/ReadMe.pod +9 -3
  54. data/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim +7 -2
  55. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.gitrepo +12 -0
  56. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.travis.yml +6 -0
  57. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Changes +11 -0
  58. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/License +1 -1
  59. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Makefile +25 -0
  60. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Meta +3 -3
  61. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/ReadMe.pod +2 -2
  62. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ +8 -7
  63. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/doc/bash+.swim +1 -1
  64. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash +85 -38
  65. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man1/bash+.1 +8 -8
  66. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man3/bash+.3 +8 -8
  67. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/base.t +4 -4
  68. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/die.t +17 -0
  69. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/fcopy.t +2 -2
  70. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/{test.bash → setup} +17 -8
  71. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/shellcheck.t +38 -0
  72. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t +10 -10
  73. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+.t +10 -10
  74. data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/use.t +8 -4
  75. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.gitrepo +12 -0
  76. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.travis.yml +5 -0
  77. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Changes +11 -0
  78. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/License +1 -1
  79. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Makefile +30 -0
  80. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Meta +3 -3
  81. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod +2 -2
  82. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim +1 -1
  83. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash +46 -42
  84. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/man/man3/test-tap.3 +8 -8
  85. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t +1 -1
  86. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail.t +1 -1
  87. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t +1 -1
  88. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/helper.bash +1 -1
  89. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/shellcheck.t +42 -0
  90. data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/tap.t +11 -5
  91. data/vendor/git-subrepo/ext/test-more-bash/lib/test/more.bash +35 -15
  92. data/vendor/git-subrepo/ext/test-more-bash/man/man3/test-more.3 +16 -10
  93. data/vendor/git-subrepo/ext/test-more-bash/test/fail.t +15 -1
  94. data/vendor/git-subrepo/ext/test-more-bash/test/more.t +12 -4
  95. data/vendor/git-subrepo/ext/test-more-bash/test/setup +3 -3
  96. data/vendor/git-subrepo/ext/test-more-bash/test/shellcheck.t +35 -0
  97. data/vendor/git-subrepo/ext/test-more-bash/test/test/fail1.t +14 -1
  98. data/vendor/git-subrepo/lib/git-subrepo +375 -260
  99. data/vendor/git-subrepo/lib/git-subrepo.d/help-functions.bash +21 -22
  100. data/vendor/git-subrepo/man/man1/git-subrepo.1 +125 -141
  101. data/vendor/git-subrepo/pkg/bin/generate-completion.pl +0 -7
  102. data/vendor/git-subrepo/pkg/bin/generate-help-functions.pl +0 -2
  103. data/vendor/git-subrepo/share/completion.bash +1 -3
  104. data/vendor/git-subrepo/share/enable-completion.sh +3 -3
  105. data/vendor/git-subrepo/share/zsh-completion/_git-subrepo +2 -7
  106. data/vendor/git-subrepo/test/Dockerfile +112 -0
  107. data/vendor/git-subrepo/test/branch-all.t +6 -6
  108. data/vendor/git-subrepo/test/branch-rev-list-one-path.t +7 -8
  109. data/vendor/git-subrepo/test/branch-rev-list.t +7 -8
  110. data/vendor/git-subrepo/test/branch.t +9 -9
  111. data/vendor/git-subrepo/test/clean.t +3 -3
  112. data/vendor/git-subrepo/test/clone-annotated-tag.t +7 -7
  113. data/vendor/git-subrepo/test/clone.t +20 -25
  114. data/vendor/git-subrepo/test/config.t +7 -6
  115. data/vendor/git-subrepo/test/encode.t +17 -17
  116. data/vendor/git-subrepo/test/error.t +18 -18
  117. data/vendor/git-subrepo/test/fetch.t +4 -4
  118. data/vendor/git-subrepo/test/gitignore.t +8 -8
  119. data/vendor/git-subrepo/test/init.t +6 -7
  120. data/vendor/git-subrepo/test/issue29.t +3 -3
  121. data/vendor/git-subrepo/test/issue95.t +2 -2
  122. data/vendor/git-subrepo/test/issue96.t +3 -3
  123. data/vendor/git-subrepo/test/pull-all.t +5 -5
  124. data/vendor/git-subrepo/test/pull-merge.t +16 -15
  125. data/vendor/git-subrepo/test/pull-message.t +12 -12
  126. data/vendor/git-subrepo/test/pull-new-branch.t +8 -7
  127. data/vendor/git-subrepo/test/pull-ours.t +10 -10
  128. data/vendor/git-subrepo/test/pull-theirs.t +8 -8
  129. data/vendor/git-subrepo/test/pull-twice.t +4 -4
  130. data/vendor/git-subrepo/test/pull-worktree.t +5 -5
  131. data/vendor/git-subrepo/test/pull.t +14 -14
  132. data/vendor/git-subrepo/test/push-after-init.t +7 -6
  133. data/vendor/git-subrepo/test/push-after-push-no-changes.t +27 -0
  134. data/vendor/git-subrepo/test/push-force.t +7 -6
  135. data/vendor/git-subrepo/test/push-new-branch.t +10 -10
  136. data/vendor/git-subrepo/test/push-no-changes.t +3 -3
  137. data/vendor/git-subrepo/test/push-squash.t +7 -7
  138. data/vendor/git-subrepo/test/push.t +35 -34
  139. data/vendor/git-subrepo/test/rebase.t +63 -0
  140. data/vendor/git-subrepo/test/reclone.t +15 -8
  141. data/vendor/git-subrepo/test/setup +62 -55
  142. data/vendor/git-subrepo/test/shellcheck.t +37 -0
  143. data/vendor/git-subrepo/test/status.t +47 -27
  144. data/vendor/git-subrepo/test/submodule.t +4 -4
  145. data/vendor/git-subrepo/test/zsh.t +27 -0
  146. metadata +42 -22
@@ -13,8 +13,8 @@ clone-foo-and-bar
13
13
 
14
14
  {
15
15
  is "$(
16
- cd $OWNER/bar
17
- git subrepo --quiet clone ../../../$UPSTREAM/foo
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 ../../../$UPSTREAM/foo
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 '../../../tmp/upstream/bar' (master)." \
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 '../../../tmp/upstream/bar' (master)." \
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="$(cd $OWNER/foo; git rev-parse HEAD^)"
50
- bar_head_commit="$(cd $OWNER/bar; git rev-parse HEAD)"
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" "../../../$UPSTREAM/bar"
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" "`git subrepo --version`"
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" "`git subrepo --version`"
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" "`git subrepo --version`"
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 master
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 master
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 "`! git:branch-exists "subrepo-push/share"`" \
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 master
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' (master)."
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' (master)."
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 master -u
90
+ git subrepo push sub -b "$DEFAULTBRANCH" -u
91
91
  )" \
92
- "Subrepo 'sub' pushed to '../sub' (master)."
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="$(cd $OWNER/foo; git rev-parse HEAD^)"
25
- bar_head_commit="$(cd $OWNER/bar; git rev-parse HEAD^)"
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="$(cd $OWNER/foo; git rev-parse HEAD)"
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="$(cd $OWNER/foo; git log --format=%B -n 1)"
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="$(cd $OWNER/bar; git rev-parse HEAD)"
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="$(cd $OWNER/foo; git log --format=%B -n 1)"
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 '../../../tmp/upstream/bar' (master)." \
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="$(cd $OWNER/foo; git log --format=%B -n 1)"
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 '../../../tmp/upstream/bar' (master)." \
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 '../../../tmp/upstream/bar' (master)." \
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 "../../../$UPSTREAM/bar"
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 "../../../$UPSTREAM/bar"
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="$(date -r $OWNER/foo/Foo '+%s')"
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="$(date -r $OWNER/foo/Foo '+%s')"
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