X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-sh-setup.sh;h=94e26ed5e8dcf84c4f238c76b6c508dc84d0b7ea;hb=aa0bcf962a6657226b729f263ca4b8e768ed6d5d;hp=aa16b8356507e4e669ee5c4cb4b5a667942d559e;hpb=93446aa760041a5a6f55605d94cdfad7bcd5a2f1;p=git.git diff --git a/git-sh-setup.sh b/git-sh-setup.sh index aa16b8356..94e26ed5e 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -140,6 +140,13 @@ cd_to_toplevel () { } } +require_work_tree_exists () { + if test "z$(git rev-parse --is-bare-repository)" != zfalse + then + die "fatal: $0 cannot be used without a working tree." + fi +} + require_work_tree () { test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true || die "fatal: $0 cannot be used without a working tree."