Skip to contentSkip to conversation

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

PATCH New Eric Wong 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

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

Also, allow messages from tags to be used as
commit messages.

---
 contrib/git-svn/git-svn.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
contrib/git-svn/git-svn.perl +3 -3
index 8bc4188..7cbfb6e 100755
@@ -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};
@@ -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>) {
Signature · 1 line
1.4.1.gda58