Skip to content

Commit 653e121

Browse files
committed
refactor: write code for fetch command
1 parent 283a7ca commit 653e121

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

modules/yadm/mod.nu

+54-2
Original file line numberDiff line numberDiff line change
@@ -1596,10 +1596,62 @@ export def fetch [
15961596
--server-option(-o): string
15971597
--show-forced-updates
15981598
--no-show-forced-updates
1599-
-4
1600-
-6
1599+
--ipv4(-4)
1600+
--ipv6(-6)
16011601
] {
16021602

1603+
let viable_bash_string_flags = generate_viable_bash_string_flags {
1604+
all:$all
1605+
append:$append
1606+
atomic:$atomic
1607+
depth: int
1608+
deepen: int
1609+
shallow-since: string
1610+
shallow-exclude: string
1611+
unshallow:$unshallow
1612+
update-shallow:$update_shallow
1613+
negotiation-tip: string
1614+
negotiate-only:$negotiate_only
1615+
dry-run:$dry_run
1616+
write-fetch-head:$write_fetch_head
1617+
no-write-fetch-head:$no_write_fetch_head
1618+
force:$force
1619+
keep:$keep
1620+
multiple:$multiple
1621+
auto-maintenance:$auto_maintenance
1622+
no-auto-maintenance:$no_auto_maintenance
1623+
auto-gc:$auto_gc
1624+
no-auto-gc:$no_auto_gc
1625+
write-commit-graph:$write_commit_graph
1626+
no-write-commit-graph:$no_write_commit_graph
1627+
prefetch:$prefetch
1628+
prune:$prune
1629+
prune-tags:$prune_tags
1630+
no-tags:$no_tags
1631+
refmap:$refmap
1632+
tags:$tags
1633+
recurse-submodules:$recurse_submodules
1634+
jobs:$jobs
1635+
no-recurse-submodules:$no_recurse_submodules
1636+
set-upstream:$set_upstream
1637+
submodule-prefix:$submodule_prefix
1638+
upload-pack:$upload_pack
1639+
quiet:$quiet
1640+
verbose:$verbose
1641+
progress:$progress
1642+
server-option:$server_option
1643+
show-forced-updates:$show_forced_updates
1644+
no-show-forced-updates:$no_show_forced_updates
1645+
ipv4:$ipv4
1646+
ipv6:$ipv6
1647+
}
1648+
1649+
if ($repository | describe) != nothing {
1650+
1651+
return (bash_yadm fetch $repository ...$viable_bash_string_flags)
1652+
}
1653+
1654+
bash_yadm fetch ...$viable_bash_string_flags
16031655

16041656
}
16051657

0 commit comments

Comments
 (0)