summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eabd73a)
raw | patch | inline | side by side (parent: eabd73a)
author | Michael Haggerty <mhagger@alum.mit.edu> | |
Sat, 18 Jun 2011 06:48:00 +0000 (08:48 +0200) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Tue, 28 Jun 2011 03:26:11 +0000 (03:26 +0000) |
If the bottom of a mergeinfo range is a commit that maps to a git root
commit, then it doesn't have a parent. In such a case, use git commit
range "$top_commit" rather than "$bottom_commit^..$top_commit".
[ew: line-wrap at 80 columns]
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
commit, then it doesn't have a parent. In such a case, use git commit
range "$top_commit" rather than "$bottom_commit^..$top_commit".
[ew: line-wrap at 80 columns]
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history | |
t/t9159-git-svn-no-parent-mergeinfo.sh | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index 1f1aa5710988b179b3c92af1e11dc7ff72021062..89f83fd27abe315804173a809b3c7ef00ead6527 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
next;
}
- push @merged_commit_ranges,
- "$bottom_commit^..$top_commit";
+ if (scalar(command('rev-parse', "$bottom_commit^@"))) {
+ push @merged_commit_ranges,
+ "$bottom_commit^..$top_commit";
+ } else {
+ push @merged_commit_ranges, "$top_commit";
+ }
if ( !defined $tip or $top > $tip ) {
$tip = $top;
index 9472de3ab0767c2132b0345ddd0cebd76c9c0ebc..85120b70db8cfb60b8d8c38f85a9038aa856468a 100755 (executable)
test_description='git svn handling of root commits in merge ranges'
. ./lib-git-svn.sh
-test_expect_failure 'test handling of root commits in merge ranges' '
+test_expect_success 'test handling of root commits in merge ranges' '
mkdir -p init/trunk init/branches init/tags &&
echo "r1" > init/trunk/file.txt &&
svn_cmd import -m "initial import" init "$svnrepo" &&