diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index 0afae009dc5..8d0de055c75 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -148,6 +148,12 @@ init_submodules(){ git config -f .gitmodules --get-regexp submodule\.[^.]*\.path | sed -n "s,^\(.*\)\.path $dir\$,\\1,p") local url=$(git config -f .gitmodules --get ${name}.url); + + # Get Absolute URL if we have a relative URL + if ! echo "$url" | grep '^[a-zA-Z]\+://' >/dev/null 2>&1; then + url="$(git config --get remote.origin.url)/$url" + fi + clone "$dir" "$url" "$hash" ""; done; }