From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: git@vger.kernel.org
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Subject: [PATCH] git-gui: fix worktree initialization with empty prefix
Date: Mon, 22 Feb 2010 16:19:24 +0100 [thread overview]
Message-ID: <1266851964-13044-1-git-send-email-giuseppe.bilotta@gmail.com> (raw)
In-Reply-To: <vpqaav1llpn.fsf@bauges.imag.fr>
This is sort of a chicken-and-egg problem, because we should only
bother setting the worktree if we are not in a bare repository, but
an unset worktree is one of the conditions we check to see if we have
a bare repository.
Maintain the same sequence of checks, but swap the check for bareness
support and bareness of repository, and check again for an unset
worktree if we are not in the bare case.
---
git-gui/git-gui.sh | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 7d54511..d9e1598 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1169,12 +1169,13 @@ if {$_prefix ne {}} {
}
set _gitworktree [pwd]
unset cdup
-} elseif {![is_enabled bare]} {
- if {[is_bare]} {
+} elseif {[is_bare]} {
+ if {![is_enabled bare]} {
catch {wm withdraw .}
error_popup [strcat [mc "Cannot use bare repository:"] "\n\n$_gitdir"]
exit 1
}
+} else {
if {$_gitworktree eq {}} {
set _gitworktree [file dirname $_gitdir]
}
--
1.7.0.198.g1e558.dirty
next prev parent reply other threads:[~2010-02-22 15:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-22 8:27 [BUG] git gui blame: Show History Context broken since 29e5573d Matthieu Moy
2010-02-22 15:18 ` Giuseppe Bilotta
2010-02-22 22:38 ` Heiko Voigt
2010-02-22 23:29 ` Giuseppe Bilotta
2010-02-23 6:40 ` Matthieu Moy
2010-02-23 21:30 ` Re: " Heiko Voigt
2010-02-22 15:19 ` Giuseppe Bilotta [this message]
2010-02-22 15:32 ` [PATCH] git-gui: fix worktree initialization with empty prefix Matthieu Moy
2010-02-22 15:39 ` Giuseppe Bilotta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1266851964-13044-1-git-send-email-giuseppe.bilotta@gmail.com \
--to=giuseppe.bilotta@gmail.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).