mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-18 01:54:34 +00:00
nix-prefetch-git: report deepClone & leaveDotGit
Just like in be30ba8e0e
we want `fetchgit (builtins.fromJSON (builtins.readFile ./src.json))` to work.
This commit is contained in:
parent
8130f3c1c2
commit
f19a101a73
@ -25,7 +25,7 @@ commitDateStrict8601=
|
|||||||
if test -n "$deepClone"; then
|
if test -n "$deepClone"; then
|
||||||
deepClone=true
|
deepClone=true
|
||||||
else
|
else
|
||||||
deepClone=false
|
deepClone=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$leaveDotGit" != 1; then
|
if test "$leaveDotGit" != 1; then
|
||||||
@ -65,7 +65,7 @@ for arg; do
|
|||||||
--branch-name) argfun=set_branchName;;
|
--branch-name) argfun=set_branchName;;
|
||||||
--deepClone) deepClone=true;;
|
--deepClone) deepClone=true;;
|
||||||
--quiet) QUIET=true;;
|
--quiet) QUIET=true;;
|
||||||
--no-deepClone) deepClone=false;;
|
--no-deepClone) deepClone=;;
|
||||||
--leave-dotGit) leaveDotGit=true;;
|
--leave-dotGit) leaveDotGit=true;;
|
||||||
--fetch-submodules) fetchSubmodules=true;;
|
--fetch-submodules) fetchSubmodules=true;;
|
||||||
--builder) builder=true;;
|
--builder) builder=true;;
|
||||||
@ -150,7 +150,7 @@ checkout_ref(){
|
|||||||
local hash="$1"
|
local hash="$1"
|
||||||
local ref="$2"
|
local ref="$2"
|
||||||
|
|
||||||
if "$deepClone"; then
|
if [[ -n "$deepClone" ]]; then
|
||||||
# The caller explicitly asked for a deep clone. Deep clones
|
# The caller explicitly asked for a deep clone. Deep clones
|
||||||
# allow "git describe" and similar tools to work. See
|
# allow "git describe" and similar tools to work. See
|
||||||
# https://marc.info/?l=nix-dev&m=139641582514772
|
# https://marc.info/?l=nix-dev&m=139641582514772
|
||||||
@ -369,7 +369,9 @@ print_results() {
|
|||||||
"rev": "$(json_escape "$fullRev")",
|
"rev": "$(json_escape "$fullRev")",
|
||||||
"date": "$(json_escape "$commitDateStrict8601")",
|
"date": "$(json_escape "$commitDateStrict8601")",
|
||||||
"$(json_escape "$hashType")": "$(json_escape "$hash")",
|
"$(json_escape "$hashType")": "$(json_escape "$hash")",
|
||||||
"fetchSubmodules": $([[ -n "$fetchSubmodules" ]] && echo true || echo false)
|
"fetchSubmodules": $([[ -n "$fetchSubmodules" ]] && echo true || echo false),
|
||||||
|
"deepClone": $([[ -n "$deepClone" ]] && echo true || echo false),
|
||||||
|
"leaveDotGit": $([[ -n "$leaveDotGit" ]] && echo true || echo false)
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user