Skip to content

Commit 03bb366

Browse files
bk2204gitster
authored andcommitted
svn: use correct variable name for short OID
The commit 9ab3315 ("perl: create and switch variables for hash constants", 2020-06-22) converted each instance of the variable $sha1_short into $oid_short in the Subversion code, since git-svn now understands SHA-256. However, one conversion was missed. As a result, Perl complains about the use of this variable: Use of uninitialized value $sha1_short in regexp compilation at /usr/lib64/perl5/vendor_perl/5.30.3/Git/SVN/Log.pm line 301, <$fh> line 6. Because we're parsing raw diff output here, the likelihood is very low that we'll actually misparse the data, since the only lines we're going to get starting with colons are the ones we're expecting. Even if we had a newline in a path, we'd end up with a quoted path. Our regex is just less strict than we'd like it to be. However, it's obviously undesirable that our code is emitting Perl warnings, so let's convert it to use the proper variable name. Reported-by: Nikos Chantziaras <[email protected]> Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 47ae905 commit 03bb366

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

perl/Git/SVN/Log.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ sub cmd_show_log {
298298
get_author_info($c, $1, $2, $3);
299299
} elsif (/^${esc_color}(?:tree|parent|committer) /o) {
300300
# ignore
301-
} elsif (/^${esc_color}:\d{6} \d{6} $::sha1_short/o) {
301+
} elsif (/^${esc_color}:\d{6} \d{6} $::oid_short/o) {
302302
push @{$c->{raw}}, $_;
303303
} elsif (/^${esc_color}[ACRMDT]\t/) {
304304
# we could add $SVN->{svn_path} here, but that requires

0 commit comments

Comments
 (0)