[PATCH 1/3] git-gui: properly check for a bare repo
- From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
- Date
- Feb 9, 2009, 02:00 UTC
- Message-ID
- <1234144850-2903-2-git-send-email-giuseppe.bilotta@gmail.com>
- In-Reply-To
- <1234144850-2903-1-git-send-email-giuseppe.bilotta@gmail.com>
When bare repository handling is not enabled, check for a bare repository looking at the core.bare config option rather than refusing to operate with a git directory ending with .git.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> --- I know I should have probably used something like git rev-parse --is-bare-repository instead, but I didn't feel like adding another git call. Is the config approach robust enough?
git-gui/git-gui.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index e018e07..658a728 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -1071,7 +1071,7 @@ if {$_prefix ne {}} { } unset cdup } elseif {![is_enabled bare]} { - if {[lindex [file split $_gitdir] end] ne {.git}} { + if {[is_config_true core.bare]} { catch {wm withdraw .} error_popup [strcat [mc "Cannot use funny .git directory:"] "\n\n$_gitdir"] exit 1
-- 1.6.2.rc0.173.g5e148