git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andrew Wong <andrew.kw.w@gmail.com>
To: git@vger.kernel.org
Cc: Andrew Wong <andrew.kw.w@gmail.com>
Subject: [PATCH 2/2] git-gui: Don't prepend the prefix if value looks like a full path
Date: Tue,  2 Oct 2012 12:25:15 -0400	[thread overview]
Message-ID: <1349195115-15494-3-git-send-email-andrew.kw.w@gmail.com> (raw)
In-Reply-To: <1349195115-15494-1-git-send-email-andrew.kw.w@gmail.com>

When argument parsing fails to detect a file name, "git-gui" will try to
use the previously detected "head" as the file name. We should avoid
prepending the prefix if "head" looks like a full path.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
---
 git-gui.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index 5d7894b..89f636f 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3037,8 +3037,13 @@ blame {
 	unset is_path
 
 	if {$head ne {} && $path eq {}} {
-		set path [normalize_relpath $_prefix$head]
-		set head {}
+		if {[string index $head 0] eq {/}} {
+			set path [normalize_relpath $head]
+			set head {}
+		} else {
+			set path [normalize_relpath $_prefix$head]
+			set head {}
+		}
 	}
 
 	if {$head eq {}} {
-- 
1.7.12.1.382.gb0576a6

  parent reply	other threads:[~2012-10-02 16:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 16:25 [PATCH] git-gui: Few issues with using full path name Andrew Wong
2012-10-02 16:25 ` [PATCH 1/2] git-gui: Detect full path when parsing arguments Andrew Wong
2012-10-02 16:25 ` Andrew Wong [this message]
2012-10-07 21:25 ` [PATCH] git-gui: Few issues with using full path name Andrew Wong
2012-10-12 14:08 ` Andrew Wong

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349195115-15494-3-git-send-email-andrew.kw.w@gmail.com \
    --to=andrew.kw.w@gmail.com \
    --cc=git@vger.kernel.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).