Git.pm: Always set Repository to absolute path if autodetecting
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> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Frank Lichtenheld committed
May 7, 2009 at 15:41 UTC
fe53bbc9bebb853f97f0da3f63f7fca5774e3f95
2 files changed
+3
-9
perl/Git.pm
+1
-1
@@ -185,7 +185,7 @@ sub repository {
185
186
if ($dir) {
187
$dir =~ m#^/# or $dir = $opts{Directory} . '/' . $dir;
188
- $opts{Repository} = $dir;
188
+ $opts{Repository} = abs_path($dir);
189
190
# If --git-dir went ok, this shouldn't die either.
191
my $prefix = $search->command_oneline('rev-parse', '--show-prefix');
t/t9700/test.pl
+2
-8
@@ -86,18 +86,12 @@ close TEMPFILE;
86
unlink $tmpfile;
87
88
# paths
89
-is($r->repo_path, "./.git", "repo_path");
89
+is($r->repo_path, $abs_repo_dir . "/.git", "repo_path");
90
is($r->wc_path, $abs_repo_dir . "/", "wc_path");
91
is($r->wc_subdir, "", "wc_subdir initial");
92
$r->wc_chdir("directory1");
93
is($r->wc_subdir, "directory1", "wc_subdir after wc_chdir");
94
-TODO: {
95
- local $TODO = "commands do not work after wc_chdir";
96
- # Failure output is active even in non-verbose mode and thus
97
- # annoying. Hence we skip these tests as long as they fail.
98
- todo_skip 'config after wc_chdir', 1;
99
- is($r->config("color.string"), "value", "config after wc_chdir");
100
-}
94
+is($r->config("test.string"), "value", "config after wc_chdir");
95
96
# Object generation in sub directory
97
chdir("directory2");