Skip to content

Commit 711521e

Browse files
Eric Wonggitster
authored andcommitted
git-svn: fix dcommit to urls with embedded usernames
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>
1 parent 4dc1db0 commit 711521e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

git-svn.perl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ sub cmd_dcommit {
421421
$head ||= 'HEAD';
422422
my @refs;
423423
my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
424-
$url = $_commit_url if defined $_commit_url;
424+
$url = defined $_commit_url ? $_commit_url : $gs->full_url;
425425
my $last_rev = $_revision if defined $_revision;
426426
if ($url) {
427427
print "Committing to $url ...\n";
@@ -437,6 +437,8 @@ sub cmd_dcommit {
437437
"If these changes depend on each other, re-running ",
438438
"without --no-rebase may be required."
439439
}
440+
my $expect_url = $url;
441+
Git::SVN::remove_username($expect_url);
440442
while (1) {
441443
my $d = shift @$linear_refs or last;
442444
unless (defined $last_rev) {
@@ -511,9 +513,9 @@ sub cmd_dcommit {
511513
$gs->refname,
512514
"\nBefore dcommitting";
513515
}
514-
if ($url_ ne $url) {
516+
if ($url_ ne $expect_url) {
515517
fatal "URL mismatch after rebase: ",
516-
"$url_ != $url";
518+
"$url_ != $expect_url";
517519
}
518520
if ($uuid_ ne $uuid) {
519521
fatal "uuid mismatch after rebase: ",

0 commit comments

Comments
 (0)