diff options
author | Thomas Rast <trast@student.ethz.ch> | 2008-08-26 21:32:36 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-09-05 16:58:39 -0700 |
commit | edde9112abd1ef5f4565468e8a9a500e0c03f900 (patch) | |
tree | 556900f1364a736b3876f80167fa1bd5506e3724 /git-svn.perl | |
parent | 8d5100c7a81e7f638241b5af957e05216cd56579 (diff) | |
download | git-edde9112abd1ef5f4565468e8a9a500e0c03f900.tar.gz |
git svn info: make info relative to the current directory
Previously 'git svn info <path>' would always treat the <path> as
relative to the working directory root, with a default of ".". This
does not match the behaviour of 'svn info'. Prepend $(git rev-parse
--show-prefix) to the path used inside cmd_info to make it relative to
the current working directory.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-x | git-svn.perl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl index 484b4ab0da..5e61dd9c12 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -805,6 +805,7 @@ sub cmd_commit_diff { sub cmd_info { my $path = canonicalize_path(defined($_[0]) ? $_[0] : "."); + my $fullpath = canonicalize_path($cmd_dir_prefix . $path); if (exists $_[1]) { die "Too many arguments specified\n"; } @@ -825,7 +826,7 @@ sub cmd_info { # canonicalize_path() will return "" to make libsvn 1.5.x happy, $path = "." if $path eq ""; - my $full_url = $url . ($path eq "." ? "" : "/$path"); + my $full_url = $url . ($fullpath eq "" ? "" : "/$fullpath"); if ($_url) { print $full_url, "\n"; @@ -861,7 +862,7 @@ sub cmd_info { } my ($lc_author, $lc_rev, $lc_date_utc); - my @args = Git::SVN::Log::git_svn_log_cmd($rev, $rev, "--", $path); + my @args = Git::SVN::Log::git_svn_log_cmd($rev, $rev, "--", $fullpath); my $log = command_output_pipe(@args); my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/; while (<$log>) { |