Skip to content

Commit

Permalink
git-svn: fix dcommit to urls with embedded usernames
Browse files Browse the repository at this point in the history
Don't rely on the extracted URL from working_head_info since that has the
username removed.  Instead use the $gs->full_url method (as before with
ba24e74 (git-svn: add ability to specify --commit-url for dcommit,
2008-08-07)) to give us the URL to commit to if --commit-url is not
specified.

Aditionally, since we clean usernames from URLs, checking the URL after
rebase can fail because it doesn't match the URL we used to commit; so
unconditionally provide a username-free URL for checking the result of the
refetch.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Eric Wong authored and gitster committed Aug 21, 2008
1 parent 4dc1db0 commit 711521e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions git-svn.perl
Expand Up @@ -421,7 +421,7 @@ sub cmd_dcommit {
$head ||= 'HEAD';
my @refs;
my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
$url = $_commit_url if defined $_commit_url;
$url = defined $_commit_url ? $_commit_url : $gs->full_url;
my $last_rev = $_revision if defined $_revision;
if ($url) {
print "Committing to $url ...\n";
Expand All @@ -437,6 +437,8 @@ sub cmd_dcommit {
"If these changes depend on each other, re-running ",
"without --no-rebase may be required."
}
my $expect_url = $url;
Git::SVN::remove_username($expect_url);
while (1) {
my $d = shift @$linear_refs or last;
unless (defined $last_rev) {
Expand Down Expand Up @@ -511,9 +513,9 @@ sub cmd_dcommit {
$gs->refname,
"\nBefore dcommitting";
}
if ($url_ ne $url) {
if ($url_ ne $expect_url) {
fatal "URL mismatch after rebase: ",
"$url_ != $url";
"$url_ != $expect_url";
}
if ($uuid_ ne $uuid) {
fatal "uuid mismatch after rebase: ",
Expand Down

0 comments on commit 711521e

Please sign in to comment.