~kaction/forge-link

d12cce35943bac2e05536ea414125aa6a0066567 — Dmitry Bogatov 1 year, 6 months ago 19384d7
Simplify code to handle files not in repository root
1 files changed, 1 insertions(+), 3 deletions(-)

M forge-link
M forge-link => forge-link +1 -3
@@ 24,10 24,8 @@ if [ ! -e "${file}" ]; then
	exit 1
fi

containing_dir=$(dirname "${file}")
cd "${containing_dir}"
gitroot=$(git rev-parse --show-toplevel)
abspath=$(realpath "${file}")
abspath=$(readlink -e "${file}")
relpath=${abspath##${gitroot}}
sha1=$(git rev-parse HEAD)