about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 0afae009dc57..8d0de055c756 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;
 }