From: Simon McVittie Date: Mon, 26 Dec 2016 18:20:41 +0000 (+0000) Subject: git: don't issue a warning if rcsinfo is undefined X-Git-Tag: debian/3.20120629.2+deb7u2~26 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/c47839389abb8e21a94606a2c105e5c1ecf6ed32?ds=inline;hp=e39366315cd153fc794aed7a9b4df587115d49e7 git: don't issue a warning if rcsinfo is undefined The intention here seems to be that $prev may be undefined, and the only way that can legitimately happen is for $params{token} to be undefined too. (cherry picked from commit fd14cd2a4355684951bb40a1e72e8b0960a674fd) --- diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 95307d1ba..5ec68b0ce 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -567,7 +567,10 @@ sub rcs_commit (@) { # Check to see if the page has been changed by someone else since # rcs_prepedit was called. my $cur = git_sha1_file($params{file}); - my ($prev) = $params{token} =~ /^($sha1_pattern)$/; # untaint + my $prev; + if (defined $params{token}) { + ($prev) = $params{token} =~ /^($sha1_pattern)$/; # untaint + } if (defined $cur && defined $prev && $cur ne $prev) { my $conflict = merge_past($prev, $params{file}, $dummy_commit_msg);