@matheusbsbs / matheus-bagliano / commits / 4ad4515dfe
Fork 0

git-svn: fix --file/-F option in commit-diff

Also, allow messages from tags to be used as commit messages. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric Wong committed Jul 9, 2006 at 20:20 UTC 4ad4515dfe15bec59ede5d526c2794bd30b04d86
1 file changed +3 -3
git-svn.perl
+3 -3
@@ -760,7 +760,7 @@ sub commit_diff {
760 exit 1;
761 }
762 if (defined $_file) {
763 - $_message = file_to_s($_message);
763 + $_message = file_to_s($_file);
764 } else {
765 $_message ||= get_commit_message($tb,
766 "$GIT_DIR/.svn-commit.tmp.$$")->{msg};
@@ -1518,12 +1518,12 @@ sub get_commit_message {
1518 open my $msg, '>', $commit_msg or croak $!;
1519
1520 chomp(my $type = `git-cat-file -t $commit`);
1521 - if ($type eq 'commit') {
1521 + if ($type eq 'commit' || $type eq 'tag') {
1522 my $pid = open my $msg_fh, '-|';
1523 defined $pid or croak $!;
1524
1525 if ($pid == 0) {
1526 - exec(qw(git-cat-file commit), $commit) or croak $!;
1526 + exec('git-cat-file', $type, $commit) or croak $!;
1527 }
1528 my $in_msg = 0;
1529 while (<$msg_fh>) {