From: Frank Lichtenheld <frank@lichtenheld.de>
To: gitster@pobox.com
Cc: Petr Baudis <pasky@suse.cz>, git@vger.kernel.org
Subject: [PATCH] Git.pm: Always set Repository to absolute path if autodetecting
Date: Sat, 18 Apr 2009 17:58:50 +0200 [thread overview]
Message-ID: <1240070330-31446-2-git-send-email-frank@lichtenheld.de> (raw)
In-Reply-To: <1240070330-31446-1-git-send-email-frank@lichtenheld.de>
From: Frank Lichtenheld <flichtenheld@astaro.com>
So far we only set it to absolute paths in some cases which lead
to problems like wc_chdir not working.
Signed-off-by: Frank Lichtenheld <flichtenheld@astaro.com>
---
perl/Git.pm | 2 +-
t/t9700/test.pl | 10 ++--------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/perl/Git.pm b/perl/Git.pm
index 4313db7..e8df55d 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -185,7 +185,7 @@ sub repository {
if ($dir) {
$dir =~ m#^/# or $dir = $opts{Directory} . '/' . $dir;
- $opts{Repository} = $dir;
+ $opts{Repository} = abs_path($dir);
# If --git-dir went ok, this shouldn't die either.
my $prefix = $search->command_oneline('rev-parse', '--show-prefix');
diff --git a/t/t9700/test.pl b/t/t9700/test.pl
index d9b29ea..6c70aec 100755
--- a/t/t9700/test.pl
+++ b/t/t9700/test.pl
@@ -86,18 +86,12 @@ close TEMPFILE;
unlink $tmpfile;
# paths
-is($r->repo_path, "./.git", "repo_path");
+is($r->repo_path, $abs_repo_dir . "/.git", "repo_path");
is($r->wc_path, $abs_repo_dir . "/", "wc_path");
is($r->wc_subdir, "", "wc_subdir initial");
$r->wc_chdir("directory1");
is($r->wc_subdir, "directory1", "wc_subdir after wc_chdir");
-TODO: {
- local $TODO = "commands do not work after wc_chdir";
- # Failure output is active even in non-verbose mode and thus
- # annoying. Hence we skip these tests as long as they fail.
- todo_skip 'config after wc_chdir', 1;
- is($r->config("color.string"), "value", "config after wc_chdir");
-}
+is($r->config("test.string"), "value", "config after wc_chdir");
# Object generation in sub directory
chdir("directory2");
--
1.6.2.1
next prev parent reply other threads:[~2009-04-18 16:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-18 15:58 [PATCH] Git.pm: Set GIT_WORK_TREE if we set GIT_DIR Frank Lichtenheld
2009-04-18 15:58 ` Frank Lichtenheld [this message]
2009-04-18 18:13 ` [PATCH] Git.pm: Always set Repository to absolute path if autodetecting Johannes Schindelin
2009-04-18 21:02 ` Frank Lichtenheld
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=1240070330-31446-2-git-send-email-frank@lichtenheld.de \
--to=frank@lichtenheld.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pasky@suse.cz \
/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).