summaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-23 01:38:28 -0700
committerJunio C Hamano <gitster@pobox.com>2009-05-23 01:38:28 -0700
commit9d764f9538f63d654a1147e11920c2bc36b75194 (patch)
tree8f7c0f6f83e57a033cd0e4dfee7fdb249905c29c /perl
parent77ce907786d2c4a7789e81c83a28e829c36fab30 (diff)
parentfe53bbc9bebb853f97f0da3f63f7fca5774e3f95 (diff)
Merge branch 'fl/git-pm'
* fl/git-pm: Git.pm: Always set Repository to absolute path if autodetecting Git.pm: Set GIT_WORK_TREE if we set GIT_DIR
Diffstat (limited to 'perl')
-rw-r--r--perl/Git.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index 291ff5b53c..e8df55d2f2 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');
@@ -1280,6 +1280,8 @@ sub _cmd_exec {
my ($self, @args) = @_;
if ($self) {
$self->repo_path() and $ENV{'GIT_DIR'} = $self->repo_path();
+ $self->repo_path() and $self->wc_path()
+ and $ENV{'GIT_WORK_TREE'} = $self->wc_path();
$self->wc_path() and chdir($self->wc_path());
$self->wc_subdir() and chdir($self->wc_subdir());
}