aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-02-20 00:43:19 -0800
committerEric Wong <normalperson@yhbt.net>2007-02-23 00:57:13 -0800
commit1a97a506043691741f25e8967e76123c1114d1fb (patch)
tree041cf8e8320fa0dfd19f4522232cd9101d187452
parent0dfaf0a4e1905a9137d3f2f691620529aeb3b4fa (diff)
downloadgit-1a97a506043691741f25e8967e76123c1114d1fb.tar.gz
git-1a97a506043691741f25e8967e76123c1114d1fb.tar.xz
git-svn: give show-ignore HEAD smarts, like dcommit and log
This allows the user to run git-svn show-ignore on there current HEAD without needing to remember which branch/ref they branched from with -i. Also, find_by_url should correctly handle cases where the URL passed to it is not valid. Signed-off-by: Eric Wong <normalperson@yhbt.net>
-rwxr-xr-xgit-svn.perl4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index dc78dcf8c..b4e896691 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -425,7 +425,8 @@ sub cmd_rebase {
}
sub cmd_show_ignore {
- my $gs = Git::SVN->new;
+ my $url = (::working_head_info('HEAD'))[0];
+ my $gs = Git::SVN->find_by_url($url) || Git::SVN->new;
my $r = (defined $_revision ? $_revision : $gs->ra->get_latest_revnum);
$gs->traverse_ignore(\*STDOUT, '', $r);
}
@@ -1034,6 +1035,7 @@ sub init_remote_config {
sub find_by_url { # repos_root and, path are optional
my ($class, $full_url, $repos_root, $path) = @_;
+ return undef unless defined $full_url;
my $remotes = read_all_remotes();
if (defined $full_url && defined $repos_root && !defined $path) {
$path = $full_url;