mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
nix-prefetch-git: Convert relative submodule URLS to absolute URLS
nix-prefetch-git does not convert relative submodule urls into absolute urls based on the parent's origin. This patch adds support for repositories which are using the relative url syntax.
This commit is contained in:
parent
153b4ccf71
commit
42229f1040
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue