summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6af1db4)
raw | patch | inline | side by side (parent: 6af1db4)
author | Eric Wong <normalperson@yhbt.net> | |
Thu, 15 Feb 2007 00:29:52 +0000 (16:29 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 23 Feb 2007 08:57:12 +0000 (00:57 -0800) |
Also, warn about dirty indices and avoid an unncessary
write-tree call if the index is clean.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
write-tree call if the index is clean.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index 8a80f81add22d6d10be6f59e6f0520be0e2306cf..ace31021e745e36deadc19925bd6957530165a1e 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
my $x = command_oneline('write-tree');
my ($y) = (command(qw/cat-file commit/, $treeish) =~
/^tree ($::sha1)/mo);
- if ($y ne $x) {
- unlink $self->{index} or croak $!;
- command_noisy('read-tree', $treeish);
- }
+ return if $y eq $x;
+
+ warn "Index mismatch: $y != $x\nrereading $treeish\n";
+ unlink $self->{index} or die "unlink $self->{index}: $!\n";
+ command_noisy('read-tree', $treeish);
$x = command_oneline('write-tree');
if ($y ne $x) {
::fatal "trees ($treeish) $y != $x\n",
my $common_max = scalar @$gsv;
foreach my $gs (@$gsv) {
- if (my $last_commit = $gs->last_commit) {
- $gs->assert_index_clean($last_commit);
- }
my @tmp = split m#/#, $gs->{path};
my $p = '';
foreach (@tmp) {
}
next unless $gs->match_paths($paths, $r);
$gs->{logged_rev_props} = $logged;
+ if (my $last_commit = $gs->last_commit) {
+ $gs->assert_index_clean($last_commit);
+ }
my $log_entry = $gs->do_fetch($paths, $r);
if ($log_entry) {
$gs->do_git_commit($log_entry);