summaryrefslogtreecommitdiffstats
path: root/git/.bin/git/git-root
blob: 96fb39592eb15408f424147920ed8c11e29c1c43 (plain) (blame)
1
2
3
4
5
6
7
8
9
#!/bin/sh
set -eu

root="$(git rev-parse --show-superproject-working-tree 2>/dev/null)"
if [ -n "$root" ]; then
  echo "$root"
else
  git rev-parse --show-toplevel
fi