aboutsummaryrefslogtreecommitdiff
path: root/bin/h
blob: 4cb900d66dd9718a8ab7c48a8d38935af36d2866 (plain)
1
2
3
4
5
6
7
8
#!/bin/mksh

dir="$PWD"
while [ -n "$dir" ]; do
  [ -d "$dir/.git" ] && break
  [ "$dir" = "$HOME" ] && break
  dir="${dir%/*}"
done && echo "$dir" || return 1