about summary refs log tree commit diff
path: root/pkgs/build-support/fetchgit/builder.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/fetchgit/builder.sh')
-rw-r--r--pkgs/build-support/fetchgit/builder.sh23
1 files changed, 1 insertions, 22 deletions
diff --git a/pkgs/build-support/fetchgit/builder.sh b/pkgs/build-support/fetchgit/builder.sh
index ed3af4a7ab618..5c7d92698cc32 100644
--- a/pkgs/build-support/fetchgit/builder.sh
+++ b/pkgs/build-support/fetchgit/builder.sh
@@ -6,27 +6,6 @@ source $stdenv/setup
 
 header "exporting $url (rev $rev) into $out"
 
-git init $out
-cd $out
-git remote add origin "$url"
-git fetch --progress origin
-git remote set-head origin -a || (
-    test -n "$rev" && echo "that's ok, we want $rev" || exit 1)
-
-if test -n "$rev"; then
-    echo "Trying to checkout: $rev"
-    parsed_rev=$(
-        git rev-parse --verify "$rev" 2>/dev/null ||
-        git rev-parse --verify origin/"$rev" 2>/dev/null
-    ) 
-    git reset --hard $parsed_rev
-    git checkout -b __nixos_build__
-else
-    git checkout -b __nixos_build__ origin/HEAD
-fi
-
-if test -z "$leaveDotGit"; then
-    find $out -name .git\* | xargs rm -rf
-fi
+$fetcher --builder --url "$url" --out "$out" --rev "$rev" ${leaveDotGit:+--leave-dotGit}
 
 stopNest