aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-12-24 14:34:30 +0000
committerSimon McVittie <smcv@debian.org>2016-12-28 21:32:12 +0000
commita67f4d39448e12369426c3509967dc0d4b7afaeb (patch)
treee5a1382675412eda7d39599a715215404ec41cd0 /IkiWiki
parent7c34df633d6dd0d16538b1911694351b604104ef (diff)
downloadikiwiki-a67f4d39448e12369426c3509967dc0d4b7afaeb.tar
ikiwiki-a67f4d39448e12369426c3509967dc0d4b7afaeb.tar.gz
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.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/git.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index 7511f09cb..331b48fda 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);