Commit 050ae065 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmgs: allow /commit in Source-url with git

parent d22373f6
...@@ -91,6 +91,12 @@ git_to_tarball() ...@@ -91,6 +91,12 @@ git_to_tarball()
URL="$(echo "$URL" | sed -e 's|/tree/.*||')" URL="$(echo "$URL" | sed -e 's|/tree/.*||')"
fi fi
# allow commit
if echo "$URL" | grep -q "github\.com.*/commit/" ; then
CHECKOUT="$(echo "$URL" | sed -e 's|.*/commit/||')"
URL="$(echo "$URL" | sed -e 's|/commit/.*||')"
fi
local d="$(basename "$URL" .git)" local d="$(basename "$URL" .git)"
git clone --recurse-submodules "$URL" "$d" || fatal git clone --recurse-submodules "$URL" "$d" || fatal
...@@ -113,7 +119,7 @@ download_to() ...@@ -113,7 +119,7 @@ download_to()
local TARGET="$2" local TARGET="$2"
pushd $(dirname $TARGET) pushd $(dirname $TARGET)
# make tarball from remote git (with submodules) # make tarball from remote git (with submodules)
if echo "$URL" | grep -q "\.git$" || echo "$URL" | grep -q "github\.com.*/tree/" ; then if echo "$URL" | grep -q "\.git$" || echo "$URL" | grep -q -E "github\.com.*/(tree|commit)/" ; then
git_to_tarball "$URL" "$TARGET" git_to_tarball "$URL" "$TARGET"
local RET=$? local RET=$?
popd popd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment