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

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