Subject: [PATCH 1/2] Accept root <tree-ish> in 'git-svn commit-diff'

From: Sergey Yanovich <[email-masked]>
Date: Sun, 17 Jun 2007 22:38:56 +0300

Signed-off-by: Sergey Yanovich <[email-masked]>
---
 git-svn.perl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 50128d7..8ad291b 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2572,7 +2572,12 @@ sub generate_diff {
 	}
 	push @diff_tree, '--find-copies-harder' if $_find_copies_harder;
 	push @diff_tree, "-l$_rename_limit" if defined $_rename_limit;
-	push @diff_tree, $tree_a, $tree_b;
+	if ($tree_a eq '0000000000000000000000000000000000000000') {
+		push @diff_tree, '--root';
+	} else {
+		push @diff_tree, $tree_a;
+	}
+	push @diff_tree, $tree_b;
 	my ($diff_fh, $ctx) = command_output_pipe(@diff_tree);
 	local $/ = "\0";
 	my $state = 'meta';
@@ -2606,6 +2611,8 @@ sub generate_diff {
 			}
 			$x->{file_b} = $_;
 			$state = 'meta';
+		} elsif ($state eq 'meta' && $_ eq $tree_b &&
+			$tree_a eq '0000000000000000000000000000000000000000') {
 		} else {
 			croak "Error parsing $_\n";
 		}
-- 
1.5.2.1