summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/prelude.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/prelude.sh b/lib/prelude.sh
index c68bf5571..0350642b3 100644
--- a/lib/prelude.sh
+++ b/lib/prelude.sh
@@ -14,15 +14,14 @@ clone_or_update() {(
cd "$nixpkgs_dir"
- if [ ! -e "$nixpkgs_dir"/.git ]; then
- git init
- fi
+ git init -q
- if git remote -v | grep -q "^config\>"; then
- git remote remove config
+ if ! current_url=$(git config remote.src.url); then
+ ${cache-git} remote add "src" "$git_url"
+ elif [ $current_url != $git_url ]; then
+ ${cache-git} remote set-url src ${git_url}
fi
- git remote add config "$git_url"
git fetch config
git checkout "$git_rev"