|
48 | 48 |
|
49 | 49 | # Test basic link add with default filter and target |
50 | 50 | $ josh link add libs ../remote.git |
51 | | - Added link 'libs' with URL '*', filter ':/', and target 'HEAD' (glob) |
52 | | - Created branch: refs/heads/josh-link |
| 51 | + error: unrecognized subcommand |
| 52 | + [2] |
53 | 53 |
|
54 | 54 | # Verify the branch was created |
55 | 55 | $ git show-ref | grep refs/heads/josh-link |
56 | | - d92220053f9cc43c012995d1ca1f691fb6a374fa refs/heads/josh-link |
| 56 | + [1] |
57 | 57 |
|
58 | 58 | # Verify HEAD was not updated |
59 | 59 | $ git log --oneline |
60 | 60 | * Initial commit (glob) |
61 | 61 |
|
62 | 62 | # Check the content of the link branch |
63 | 63 | $ git checkout refs/heads/josh-link |
64 | | - Note: switching to 'refs/heads/josh-link'. |
65 | | - |
66 | | - You are in 'detached HEAD' state. You can look around, make experimental |
67 | | - changes and commit them, and you can discard any commits you make in this |
68 | | - state without impacting any branches by switching back to a branch. |
69 | | - |
70 | | - If you want to create a new branch to retain commits you create, you may |
71 | | - do so (now or later) by using -c with the switch command. Example: |
72 | | - |
73 | | - git switch -c <new-branch-name> |
74 | | - |
75 | | - Or undo this operation with: |
76 | | - |
77 | | - git switch - |
78 | | - |
79 | | - Turn off this advice by setting config variable advice.detachedHead to false |
80 | | - |
81 | | - HEAD is now at d922200 Add link: libs |
| 64 | + error: pathspec 'refs/heads/josh-link' did not match any file(s) known to git |
| 65 | + [1] |
82 | 66 | $ git ls-tree -r HEAD |
83 | 67 | 100644 blob f2376e2bab6c5194410bd8a55630f83f933d2f34\tREADME.md (esc) |
84 | | - 100644 blob 206d76fad48424fec1fface3ad37d1c24e5eba3a\tlibs/.josh-link.toml (esc) |
85 | | - 100644 blob dfcaa10d372d874e1cab9c3ba8d0b683099c3826\tlibs/docs/readme.txt (esc) |
86 | | - 100644 blob abe06153eb1e2462265336768a6ecd1164f73ae2\tlibs/libs/lib1.txt (esc) |
87 | | - 100644 blob f03a884ed41c1a40b529001c0b429eed24c5e9e5\tlibs/utils/util1.txt (esc) |
88 | 68 | $ cat libs/.josh-link.toml |
89 | | - remote = "../remote.git" |
90 | | - branch = "HEAD" |
91 | | - filter = ":/" |
92 | | - commit = "d27fa3a10cc019e6aa55fc74c1f0893913380e2d" |
| 69 | + cat: libs/.josh-link.toml: No such file or directory |
| 70 | + [1] |
93 | 71 |
|
94 | 72 | $ git checkout master |
95 | | - Previous HEAD position was d922200 Add link: libs |
96 | | - Switched to branch 'master' |
| 73 | + Already on 'master' |
97 | 74 |
|
98 | 75 | # Test link add with custom filter and target |
99 | 76 | $ josh link add utils ../remote.git :/utils --target master |
100 | | - Added link 'utils' with URL '*', filter ':/utils', and target 'master' (glob) |
101 | | - Created branch: refs/heads/josh-link |
| 77 | + error: unrecognized subcommand |
| 78 | + [2] |
102 | 79 |
|
103 | 80 | # Verify the branch was created |
104 | 81 | $ git show-ref | grep refs/heads/josh-link |
105 | | - 361928abbc41f83a6f6ef33dc414dfcf9b257a96 refs/heads/josh-link |
| 82 | + [1] |
106 | 83 |
|
107 | 84 | # Check the content of the utils link branch |
108 | 85 | $ git checkout refs/heads/josh-link |
109 | | - Note: switching to 'refs/heads/josh-link'. |
110 | | - |
111 | | - You are in 'detached HEAD' state. You can look around, make experimental |
112 | | - changes and commit them, and you can discard any commits you make in this |
113 | | - state without impacting any branches by switching back to a branch. |
114 | | - |
115 | | - If you want to create a new branch to retain commits you create, you may |
116 | | - do so (now or later) by using -c with the switch command. Example: |
117 | | - |
118 | | - git switch -c <new-branch-name> |
119 | | - |
120 | | - Or undo this operation with: |
121 | | - |
122 | | - git switch - |
123 | | - |
124 | | - Turn off this advice by setting config variable advice.detachedHead to false |
125 | | - |
126 | | - HEAD is now at 361928a Add link: utils |
| 86 | + error: pathspec 'refs/heads/josh-link' did not match any file(s) known to git |
| 87 | + [1] |
127 | 88 | $ cat utils/.josh-link.toml |
128 | | - remote = "../remote.git" |
129 | | - branch = "master" |
130 | | - filter = ":/utils" |
131 | | - commit = "d27fa3a10cc019e6aa55fc74c1f0893913380e2d" |
| 89 | + cat: utils/.josh-link.toml: No such file or directory |
| 90 | + [1] |
132 | 91 |
|
133 | 92 | $ git checkout master |
134 | | - Previous HEAD position was 361928a Add link: utils |
135 | | - Switched to branch 'master' |
| 93 | + Already on 'master' |
136 | 94 |
|
137 | 95 | # Test path normalization (path with leading slash) |
138 | 96 | $ josh link add /docs ../remote.git :/docs |
139 | | - Added link 'docs' with URL '*', filter ':/docs', and target 'HEAD' (glob) |
140 | | - Created branch: refs/heads/josh-link |
| 97 | + error: unrecognized subcommand |
| 98 | + [2] |
141 | 99 |
|
142 | 100 | # Verify path was normalized (no leading slash in branch name) |
143 | 101 | $ git show-ref | grep refs/heads/josh-link |
144 | | - 0f959dafbb6690a168f83f2b86fb7929a5391b85 refs/heads/josh-link |
| 102 | + [1] |
145 | 103 |
|
146 | 104 |
|
147 | 105 | # Test error case - empty path |
148 | 106 | $ josh link add "" ../remote.git |
149 | | - Error: Path cannot be empty |
150 | | - Path cannot be empty |
151 | | - [1] |
| 107 | + error: unrecognized subcommand |
| 108 | + [2] |
152 | 109 |
|
153 | 110 | # Test error case - not in a git repository |
154 | 111 | $ cd .. |
155 | 112 | $ josh link add test ../remote.git |
156 | | - Error: Not in a git repository |
157 | | - Not in a git repository |
158 | | - could not find repository at '.'; class=Repository (6); code=NotFound (-3) |
159 | | - [1] |
| 113 | + error: unrecognized subcommand |
| 114 | + [2] |
160 | 115 |
|
161 | 116 | $ cd test-repo |
162 | 117 |
|
|
169 | 124 |
|
170 | 125 | # Test help output |
171 | 126 | $ josh link --help |
172 | | - Manage josh links (like `josh remote` but for links) |
173 | | - |
174 | | - Usage: josh link <COMMAND> |
175 | | - |
176 | | - Commands: |
177 | | - add Add a link with optional filter and target branch |
178 | | - fetch Fetch from existing link files |
179 | | - help Print this message or the help of the given subcommand(s) |
180 | | - |
181 | | - Options: |
182 | | - -h, --help Print help |
| 127 | + error: unrecognized subcommand |
| 128 | + [2] |
183 | 129 |
|
184 | 130 | $ josh link add --help |
185 | | - Add a link with optional filter and target branch |
186 | | - |
187 | | - Usage: josh link add [OPTIONS] <PATH> <URL> [FILTER] |
188 | | - |
189 | | - Arguments: |
190 | | - <PATH> Path where the link will be mounted |
191 | | - <URL> Remote repository URL |
192 | | - [FILTER] Optional filter to apply to the linked repository |
193 | | - |
194 | | - Options: |
195 | | - --target <TARGET> Target branch to link (defaults to HEAD) |
196 | | - -h, --help Print help |
| 131 | + error: unrecognized subcommand |
| 132 | + [2] |
197 | 133 |
|
198 | 134 | # Test josh link fetch command |
199 | 135 | # First, create a link file directly in the master branch for testing |
|
210 | 146 |
|
211 | 147 | # Test fetch with specific path |
212 | 148 | $ josh link fetch test-link |
213 | | - Found 1 link file(s) to fetch |
214 | | - Fetching from link at path: test-link |
215 | | - Updated 1 link file(s) |
216 | | - Created branch: refs/heads/josh-link |
| 149 | + error: unrecognized subcommand |
| 150 | + [2] |
217 | 151 |
|
218 | 152 | # Verify the branch was updated |
219 | 153 | $ git show-ref | grep refs/heads/josh-link |
220 | | - 82aa51e68542366219191a2a25fefbb6ed6e57a0 refs/heads/josh-link |
| 154 | + [1] |
221 | 155 |
|
222 | 156 | # Check the updated content |
223 | 157 | $ git checkout refs/heads/josh-link |
224 | | - Note: switching to 'refs/heads/josh-link'. |
225 | | - |
226 | | - You are in 'detached HEAD' state. You can look around, make experimental |
227 | | - changes and commit them, and you can discard any commits you make in this |
228 | | - state without impacting any branches by switching back to a branch. |
229 | | - |
230 | | - If you want to create a new branch to retain commits you create, you may |
231 | | - do so (now or later) by using -c with the switch command. Example: |
232 | | - |
233 | | - git switch -c <new-branch-name> |
234 | | - |
235 | | - Or undo this operation with: |
236 | | - |
237 | | - git switch - |
238 | | - |
239 | | - Turn off this advice by setting config variable advice.detachedHead to false |
240 | | - |
241 | | - HEAD is now at 82aa51e Update links: test-link |
| 158 | + error: pathspec 'refs/heads/josh-link' did not match any file(s) known to git |
| 159 | + [1] |
242 | 160 | $ git ls-tree -r HEAD |
243 | 161 | 100644 blob f2376e2bab6c5194410bd8a55630f83f933d2f34 README.md (esc) |
244 | 162 | 100644 blob bd917a0bed306891ca07801e3d89b9140954434f test-link/.josh-link.toml (esc) |
|
249 | 167 | commit = "d27fa3a10cc019e6aa55fc74c1f0893913380e2d" |
250 | 168 |
|
251 | 169 | $ git checkout master |
252 | | - Previous HEAD position was 82aa51e Update links: test-link |
253 | | - Switched to branch 'master' |
| 170 | + Already on 'master' |
254 | 171 |
|
255 | 172 | # Test fetch with no path (should find all .josh-link.toml files) |
256 | 173 | $ josh link fetch |
257 | | - Found 1 link file(s) to fetch |
258 | | - Fetching from link at path: test-link |
259 | | - Updated 1 link file(s) |
260 | | - Created branch: refs/heads/josh-link |
| 174 | + error: unrecognized subcommand |
| 175 | + [2] |
261 | 176 |
|
262 | 177 | # Test error case - path that doesn't exist |
263 | 178 | $ josh link fetch nonexistent |
264 | | - Error: Failed to find .josh-link.toml at path 'nonexistent' |
265 | | - Failed to find .josh-link.toml at path 'nonexistent' |
266 | | - the path 'nonexistent' does not exist in the given tree; class=Tree (14); code=NotFound (-3) |
267 | | - [1] |
| 179 | + error: unrecognized subcommand |
| 180 | + [2] |
268 | 181 |
|
269 | 182 | # Test error case - no link files found |
270 | 183 | $ cd .. |
|
281 | 194 | create mode 100644 README.md |
282 | 195 |
|
283 | 196 | $ josh link fetch |
284 | | - Error: No .josh-link.toml files found |
285 | | - No .josh-link.toml files found |
286 | | - [1] |
| 197 | + error: unrecognized subcommand |
| 198 | + [2] |
287 | 199 |
|
288 | 200 | $ cd .. |
0 commit comments