[PATCH 3/3] git-svn: Fix discarding of extra parents from svn:mergeinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use merge-base rather than rev-list for detecting if a parent is an
ancestor of another, because rev-list gives incorrect results
sometimes.

Signed-off-by: Tuomas Suutari <tuomas.suutari@xxxxxxxxx>
---
 git-svn.perl             |    8 ++++----
 t/t9151-svn-mergeinfo.sh |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 265852f..1e2bbe5 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3268,11 +3268,11 @@ sub find_extra_svn_parents {
 				next if $i == $j;
 				next unless $new_parents[$i];
 				next unless $new_parents[$j];
-				my $revs = command_oneline(
-					"rev-list", "-1",
-					"$new_parents[$i]..$new_parents[$j]",
+				my $mergebase = command_oneline(
+					"merge-base",
+					"$new_parents[$i]", "$new_parents[$j]",
 				       );
-				if ( !$revs ) {
+				if ( $mergebase eq $new_parents[$i] ) {
 					undef($new_parents[$i]);
 				}
 			}
diff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh
index 353f543..1640824 100755
--- a/t/t9151-svn-mergeinfo.sh
+++ b/t/t9151-svn-mergeinfo.sh
@@ -33,7 +33,7 @@ test_expect_success 'svn non-merge merge commits did not become git merge commit
 	[ -z "$bad_non_merges" ]
 	'
 
-test_expect_failure 'commit made to merged branch is reachable from the merge' '
+test_expect_success 'commit made to merged branch is reachable from the merge' '
 	before_commit=$(git rev-list --all --grep="trunk commit before merging trunk to b2")
 	merge_commit=$(git rev-list --all --grep="Merge trunk to b2")
 	not_reachable=$(git rev-list -1 $before_commit --not $merge_commit)
-- 
1.7.0.86.g7501

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]