diff options
| author | Junio C Hamano <gitster@pobox.com> | 2011-05-26 10:31:47 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2011-05-26 10:31:47 -0700 |
| commit | 0a2a5d889dcd0982de31e1d4faee3242854d7b9d (patch) | |
| tree | 76982d8341e539d7280990a7dd7df8181c94702a /git-sh-setup.sh | |
| parent | 1dcfb2ac65cec5a706784d92523f0c53de0a8d95 (diff) | |
| parent | e2eb527345d48881dac0d88e6bdfc0a267a2eb62 (diff) | |
| download | git-0a2a5d889dcd0982de31e1d4faee3242854d7b9d.tar.xz | |
Merge branch 'jc/require-work-tree-exists'
* jc/require-work-tree-exists:
require-work-tree wants more than what its name says
Diffstat (limited to 'git-sh-setup.sh')
| -rw-r--r-- | git-sh-setup.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh index aa16b83565..94e26ed5e8 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." |
