~kaction/forge-link

34e1f354ed84ca01ec41051fd8814abbdf8d7fb0 — Dmitry Bogatov 1 year, 8 months ago d12cce3
Add support for ssh sourcehut remotes
1 files changed, 5 insertions(+), 2 deletions(-)

M forge-link
M forge-link => forge-link +5 -2
@@ 63,8 63,11 @@ fi
for remote; do
	base=$(git config "remote.${remote}.url")
	url=""
	if [ "${base}" != "${base##https://git.sr.ht/}" ] ; then
		url="${base}/tree/${sha1}${relpath}"
	if [ "${base}" != "${base##https://git.sr.ht/}" ] || \
		[ "${base}" != "${base##git@git.sr.ht:}" ] ; then
		repo="${base##https://git.sr.ht/}"
		repo="${repo##git@git.sr.ht:}"
		url="https://git.sr.ht/${repo}/tree/${sha1}${relpath}"
		if [ "${line}" != 0 ] ; then
			url="${url}#L${line}"
		fi