Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkgs/build-support/fetchgit/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ source $stdenv/setup
header "exporting $url (rev $rev) into $out"

$fetcher --builder --url "$url" --out "$out" --rev "$rev" \
${leaveDotGit:+--leave-dotGit} \
${fetchSubmodules:+--fetch-submodules}

stopNest
4 changes: 2 additions & 2 deletions pkgs/build-support/fetchgit/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{stdenv, git, cacert}:
{url, rev ? "HEAD", md5 ? "", sha256 ? "", leaveDotGit ? false, fetchSubmodules ? true
{url, rev ? "HEAD", md5 ? "", sha256 ? "", fetchSubmodules ? true
, name ? "git-export"
}:

Expand Down Expand Up @@ -37,7 +37,7 @@ stdenv.mkDerivation {
outputHashMode = "recursive";
outputHash = if sha256 == "" then md5 else sha256;

inherit url rev leaveDotGit fetchSubmodules;
inherit url rev fetchSubmodules;

GIT_SSL_CAINFO = "${cacert}/etc/ca-bundle.crt";

Expand Down
19 changes: 2 additions & 17 deletions pkgs/build-support/fetchgit/nix-prefetch-git
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ rev=
expHash=
hashType=$NIX_HASH_ALGO
deepClone=$NIX_PREFETCH_GIT_DEEP_CLONE
leaveDotGit=$NIX_PREFETCH_GIT_LEAVE_DOT_GIT
fetchSubmodules=
builder=

Expand All @@ -15,12 +14,6 @@ else
deepClone=false
fi

if test "$leaveDotGit" != 1; then
leaveDotGit=
else
leaveDotGit=true
fi


argi=0
argfun=""
Expand All @@ -33,7 +26,6 @@ for arg; do
--hash) argfun=set_hashType;;
--deepClone) deepClone=true;;
--no-deepClone) deepClone=false;;
--leave-dotGit) leaveDotGit=true;;
--fetch-submodules) fetchSubmodules=true;;
--builder) builder=true;;
*)
Expand Down Expand Up @@ -67,7 +59,6 @@ Options:
--hash h Expected hash.
--deepClone Clone submodules recursively.
--no-deepClone Do not clone submodules.
--leave-dotGit Keep the .git directories.
--fetch-submodules Fetch submodules.
--builder Clone as fetchgit does, but url, rev, and out option are mandatory.
"
Expand Down Expand Up @@ -223,14 +214,8 @@ clone_user_rev() {

# Allow doing additional processing before .git removal
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK"
if test -z "$leaveDotGit"; then
echo "removing \`.git'..." >&2
find $dir -name .git\* | xargs rm -rf
else
# The logs and index contain timestamps, and the hooks contain
# the nix path of git's bash
find $dir -name .git | xargs -I {} rm -rf {}/logs {}/index {}/hooks
fi
echo "removing \`.git'..." >&2
find $dir -name .git\* | xargs rm -rf
}

if test -n "$builder"; then
Expand Down