diff options
author | Jacob Moody <moody@posixcafe.org> | 2023-07-16 22:48:26 -0500 |
---|---|---|
committer | Jacob Moody <moody@posixcafe.org> | 2023-07-23 13:16:28 -0500 |
commit | 5dde2776d32b9f6ea206a13df2d5db1bc3710ad9 (patch) | |
tree | 3370e96f00f7336cfc31615c5b1f38fd2b2a9e3c /pkgs/common-updater | |
parent | db097eb3b5b82965eb7dce659479f77a25241d27 (diff) |
unstableGitUpdater: add deepClone argument for non shallow clones
Diffstat (limited to 'pkgs/common-updater')
-rw-r--r-- | pkgs/common-updater/unstable-updater.nix | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/common-updater/unstable-updater.nix b/pkgs/common-updater/unstable-updater.nix index f8944222a8d58..29b7fcf196795 100644 --- a/pkgs/common-updater/unstable-updater.nix +++ b/pkgs/common-updater/unstable-updater.nix @@ -12,6 +12,7 @@ , branch ? null , stableVersion ? false # Use version format according to RFC 107 (i.e. LAST_TAG+date=YYYY-MM-DD) , tagPrefix ? "" # strip this prefix from a tag name when using stable version +, shallowClone ? true }: let @@ -22,6 +23,7 @@ let branch="" use_stable_version="" tag_prefix="" + shallow_clone="" while (( $# > 0 )); do flag="$1" @@ -39,6 +41,9 @@ let --tag-prefix=*) tag_prefix="''${flag#*=}" ;; + --shallow-clone) + shallow_clone=1 + ;; *) echo "$0: unknown option ‘''${flag}’" exit 1 @@ -58,9 +63,12 @@ let cloneArgs=( --bare - --depth=1 ) + if [[ "$shallow_clone" == "1" ]]; then + cloneArgs+=(--depth=1) + fi + if [[ -n "$branch" ]]; then cloneArgs+=(--branch="$branch") fi @@ -101,7 +109,8 @@ let --rev="$commit_sha" ''; -in [ +in +[ updateScript "--url=${builtins.toString url}" ] ++ lib.optionals (branch != null) [ @@ -109,4 +118,6 @@ in [ ] ++ lib.optionals stableVersion [ "--use-stable-version" "--tag-prefix=${tagPrefix}" +] ++ lib.optionals shallowClone [ + "--shallow-clone" ] |