diff options
author | Eric Wong <e@80x24.org> | 2016-10-14 00:27:54 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-10-14 01:36:12 +0000 |
commit | 112423eb905cf28c9445781a7647ba590d597ab3 (patch) | |
tree | c2e79f4e9c7c80dfe758a13317f18860c34d0606 /git-svn.perl | |
parent | b26098fc2f76131f4258d800e0892e87f9138331 (diff) | |
download | git-112423eb905cf28c9445781a7647ba590d597ab3.tar.gz |
git-svn: "git worktree" awarenessew/svn-wt
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-x | git-svn.perl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/git-svn.perl b/git-svn.perl index 6d1a1422c1..fa42364785 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); |