summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-10-14 00:27:54 (GMT)
committerEric Wong <e@80x24.org>2016-10-14 01:36:12 (GMT)
commit112423eb905cf28c9445781a7647ba590d597ab3 (patch)
treec2e79f4e9c7c80dfe758a13317f18860c34d0606 /git-svn.perl
parentb26098fc2f76131f4258d800e0892e87f9138331 (diff)
downloadgit-112423eb905cf28c9445781a7647ba590d597ab3.zip
git-112423eb905cf28c9445781a7647ba590d597ab3.tar.gz
git-112423eb905cf28c9445781a7647ba590d597ab3.tar.bz2
git-svn: "git worktree" awareness
git-svn internals were previously not aware of repository layout differences for users of the "git worktree" command. Introduce this awareness by using "git rev-parse --git-path" instead of relying on outdated uses of GIT_DIR and friends. Thanks-to: Duy Nguyen <pclouds@gmail.com> Reported-by: Mathieu Arnold <mat@freebsd.org> Signed-off-by: Eric Wong <e@80x24.org>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl9
1 files changed, 5 insertions, 4 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 6d1a142..fa42364 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1700,7 +1700,7 @@ sub cmd_gc {
"files will not be compressed.\n";
}
File::Find::find({ wanted => \&gc_directory, no_chdir => 1},
- "$ENV{GIT_DIR}/svn");
+ Git::SVN::svn_dir());
}
########################### utility functions #########################
@@ -1734,7 +1734,7 @@ sub post_fetch_checkout {
return unless verify_ref('HEAD^0');
return if $ENV{GIT_DIR} !~ m#^(?:.*/)?\.git$#;
- my $index = $ENV{GIT_INDEX_FILE} || "$ENV{GIT_DIR}/index";
+ my $index = command_oneline(qw(rev-parse --git-path index));
return if -f $index;
return if command_oneline(qw/rev-parse --is-inside-work-tree/) eq 'false';
@@ -1836,8 +1836,9 @@ sub get_tree_from_treeish {
sub get_commit_entry {
my ($treeish) = shift;
my %log_entry = ( log => '', tree => get_tree_from_treeish($treeish) );
- my $commit_editmsg = "$ENV{GIT_DIR}/COMMIT_EDITMSG";
- my $commit_msg = "$ENV{GIT_DIR}/COMMIT_MSG";
+ my @git_path = qw(rev-parse --git-path);
+ my $commit_editmsg = command_oneline(@git_path, 'COMMIT_EDITMSG');
+ my $commit_msg = command_oneline(@git_path, 'COMMIT_MSG');
open my $log_fh, '>', $commit_editmsg or croak $!;
my $type = command_oneline(qw/cat-file -t/, $treeish);