Skip to content

Commit

Permalink
git-svn: give show-ignore HEAD smarts, like dcommit and log
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Wong committed Feb 23, 2007
1 parent 0dfaf0a commit 1a97a50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1a97a50

Please sign in to comment.