@matheusbsbs / matheus-bagliano / commits / 1a97a50604
Fork 0

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>

Eric Wong committed Feb 20, 2007 at 00:43 UTC 1a97a506043691741f25e8967e76123c1114d1fb
1 file changed +3 -1
git-svn.perl
+3 -1
@@ -425,7 +425,8 @@ sub cmd_rebase {
425 }
426
427 sub cmd_show_ignore {
428 - my $gs = Git::SVN->new;
428 + my $url = (::working_head_info('HEAD'))[0];
429 + my $gs = Git::SVN->find_by_url($url) || Git::SVN->new;
430 my $r = (defined $_revision ? $_revision : $gs->ra->get_latest_revnum);
431 $gs->traverse_ignore(\*STDOUT, '', $r);
432 }
@@ -1034,6 +1035,7 @@ sub init_remote_config {
1035
1036 sub find_by_url { # repos_root and, path are optional
1037 my ($class, $full_url, $repos_root, $path) = @_;
1038 + return undef unless defined $full_url;
1039 my $remotes = read_all_remotes();
1040 if (defined $full_url && defined $repos_root && !defined $path) {
1041 $path = $full_url;