summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0dfaf0a)
raw | patch | inline | side by side (parent: 0dfaf0a)
author | Eric Wong <normalperson@yhbt.net> | |
Tue, 20 Feb 2007 08:43:19 +0000 (00:43 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 23 Feb 2007 08:57:13 +0000 (00:57 -0800) |
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>
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>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index dc78dcf8cf801f01b2cc191e3fb8053d148c9561..b4e8966919e67bc8aff3235aa2cd3da706dc928a 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
}
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);
}
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;