@@ -196,68 +196,76 @@ title "gix pack"
196196 fi
197197 )
198198 )
199- title " gix pack index-from-data"
200- (with " the 'index-from-data' sub-command"
201- snapshot=" $snapshot /index-from-data"
202- PACK_FILE=" $fixtures /packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack"
203- (with " a valid and complete pack file"
204- (with " NO output directory specified"
205- (with " pack file passed as file"
206- it " generates an index into a sink and outputs pack and index information" && {
207- WITH_SNAPSHOT=" $snapshot /no-output-dir-success" \
208- expect_run $SUCCESSFULLY " $exe_plumbing " pack index-from-data -p " $PACK_FILE "
209- }
199+ (with " the 'index' sub-command"
200+ snapshot=" $snapshot /index"
201+ title " gix pack index create"
202+ (with " the 'create' sub-command"
203+ snapshot=" $snapshot /create"
204+ PACK_FILE=" $fixtures /packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack"
205+ (with " a valid and complete pack file"
206+ (with " NO output directory specified"
207+ (with " pack file passed as file"
208+ it " generates an index into a sink and outputs pack and index information" && {
209+ WITH_SNAPSHOT=" $snapshot /no-output-dir-success" \
210+ expect_run $SUCCESSFULLY " $exe_plumbing " pack index create -p " $PACK_FILE "
211+ }
212+ )
213+ (with " pack file passed from stdin"
214+ it " generates an index into a sink and outputs pack and index information" && {
215+ WITH_SNAPSHOT=" $snapshot /no-output-dir-success" \
216+ expect_run $SUCCESSFULLY " $exe_plumbing " pack index create < " $PACK_FILE "
217+ }
218+ if test " $kind " = " max" ; then
219+ (with " --format json"
220+ it " generates the index into a sink and outputs information as JSON" && {
221+ WITH_SNAPSHOT=" $snapshot /no-output-dir-as-json-success" \
222+ expect_run $SUCCESSFULLY " $exe_plumbing " --format json pack index create < " $PACK_FILE "
223+ }
224+ )
225+ fi
226+ )
210227 )
211- (with " pack file passed from stdin"
212- it " generates an index into a sink and outputs pack and index information" && {
213- WITH_SNAPSHOT=" $snapshot /no-output-dir-success" \
214- expect_run $SUCCESSFULLY " $exe_plumbing " pack index-from-data < " $PACK_FILE "
215- }
216- if test " $kind " = " max" ; then
217- (with " --format json"
218- it " generates the index into a sink and outputs information as JSON" && {
219- WITH_SNAPSHOT=" $snapshot /no-output-dir-as-json-success" \
220- expect_run $SUCCESSFULLY " $exe_plumbing " --format json pack index-from-data < " $PACK_FILE "
228+ (sandbox
229+ (with " with an output directory specified"
230+ it " generates an index and outputs information" && {
231+ WITH_SNAPSHOT=" $snapshot /output-dir-success" \
232+ expect_run $SUCCESSFULLY " $exe_plumbing " pack index create -p " $PACK_FILE " " $PWD "
233+ }
234+ it " writes the index and pack into the directory (they have the same names, different suffixes)" && {
235+ WITH_SNAPSHOT=" $snapshot /output-dir-content" \
236+ expect_run $SUCCESSFULLY ls
221237 }
222238 )
223- fi
224239 )
225240 )
226- (sandbox
227- (with " with an output directory specified "
228- it " generates an index and outputs information " && {
229- WITH_SNAPSHOT =" $snapshot /output-dir-success " \
230- expect_run $SUCCESSFULLY " $exe_plumbing " pack index-from-data -p " $PACK_FILE " " $PWD "
231- }
232- it " writes the index and pack into the directory (they have the same names, different suffixes )" && {
233- WITH_SNAPSHOT=" $snapshot /output-dir-content " \
234- expect_run $SUCCESSFULLY ls
241+ (with " 'restore' iteration mode "
242+ (sandbox
243+ cp " ${PACK_FILE} " .
244+ PACK_FILE =" ${PACK_FILE ##*/ } "
245+ " $jtt " mess-in-the-middle " ${ PACK_FILE} "
246+
247+ it " generates an index and outputs information (instead of failing )" && {
248+ WITH_SNAPSHOT=" $snapshot /output-dir-restore-success " \
249+ expect_run $SUCCESSFULLY " $exe_plumbing " pack index create -i restore -p " $PACK_FILE " " $PWD "
235250 }
251+
252+ if test " $kind " = " max" ; then
253+ (with " --format json and the very same output directory"
254+ it " generates the index, overwriting existing files, and outputs information as JSON" && {
255+ WITH_SNAPSHOT=" $snapshot /output-dir-restore-as-json-success" \
256+ SNAPSHOT_FILTER=remove-paths \
257+ expect_run $SUCCESSFULLY " $exe_plumbing " --format json pack index create -i restore $PWD < " $PACK_FILE "
258+ }
259+ )
260+ fi
236261 )
237262 )
238263 )
239- (with " 'restore' iteration mode"
240- (sandbox
241- cp " ${PACK_FILE} " .
242- PACK_FILE=" ${PACK_FILE##*/ } "
243- " $jtt " mess-in-the-middle " ${PACK_FILE} "
264+ )
244265
245- it " generates an index and outputs information (instead of failing)" && {
246- WITH_SNAPSHOT=" $snapshot /output-dir-restore-success" \
247- expect_run $SUCCESSFULLY " $exe_plumbing " pack index-from-data -i restore -p " $PACK_FILE " " $PWD "
248- }
266+ title " gix pack multi-index"
267+ (with " the 'multi-index' sub-command"
249268
250- if test " $kind " = " max" ; then
251- (with " --format json and the very same output directory"
252- it " generates the index, overwriting existing files, and outputs information as JSON" && {
253- WITH_SNAPSHOT=" $snapshot /output-dir-restore-as-json-success" \
254- SNAPSHOT_FILTER=remove-paths \
255- expect_run $SUCCESSFULLY " $exe_plumbing " --format json pack index-from-data -i restore $PWD < " $PACK_FILE "
256- }
257- )
258- fi
259- )
260- )
261269 )
262270
263271 title " gix pack explode"
0 commit comments