Commit f812d6fa authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmbsh: add git bundle support

parent b834075c
......@@ -124,6 +124,8 @@ for i in $LISTBUILT ; do
estrlist has $i $LISTNAMES || rm -fv $i
done
[ -n "$EREMOVETMPGIT" ] && rm -rf "$EREMOVETMPGIT"
date
echo "-------------------------------"
......
......@@ -457,6 +457,24 @@ parse_cmd_pre_spec()
fi
fi
# Git bundle support
if rhas "$1" "\.bundle$" && file "$1" | grep -q "Git bundle" ; then
local abspath="$(realpath "$1")"
local name="$(basename "$1" .bundle | sed -e 's| .*||')"
local tdir="$(mktemp -d)" && mkdir $tdir/$name/ || fatal
local HEAD="$(git bundle list-heads "$abspath" | grep " HEAD$" | tail -n1 | sed -e 's| HEAD.*||')"
[ -n "$HEAD" ] || fatal "can't get HEAD commit from $1"
cd "$tdir/$name/" && git init || fatal
git bundle unbundle "$abspath" || { rm -rf $tdir/ ; fatal ; }
git checkout -b master $HEAD
cd - >/dev/null
local SPEC=$(get_gear_spec $tdir/$name)
shift
parse_cmd_pre "$SPEC" "$@"
EREMOVETMPGIT="$tdir"
return
fi
# hack for check spec or src.rpm presence in command line: skip spec detecting
if rhas "$*" "\.(spec|src\.rpm)" ; then
parse_cmd_pre "$@"
......
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