Skip to content

Commit

Permalink
git-svn: fix --file/-F option in commit-diff
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Jul 10, 2006
1 parent 344c52a commit 4ad4515
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ sub commit_diff {
exit 1;
}
if (defined $_file) {
$_message = file_to_s($_message);
$_message = file_to_s($_file);
} else {
$_message ||= get_commit_message($tb,
"$GIT_DIR/.svn-commit.tmp.$$")->{msg};
Expand Down Expand Up @@ -1518,12 +1518,12 @@ sub get_commit_message {
open my $msg, '>', $commit_msg or croak $!;

chomp(my $type = `git-cat-file -t $commit`);
if ($type eq 'commit') {
if ($type eq 'commit' || $type eq 'tag') {
my $pid = open my $msg_fh, '-|';
defined $pid or croak $!;

if ($pid == 0) {
exec(qw(git-cat-file commit), $commit) or croak $!;
exec('git-cat-file', $type, $commit) or croak $!;
}
my $in_msg = 0;
while (<$msg_fh>) {
Expand Down

0 comments on commit 4ad4515

Please sign in to comment.