]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
git: do not fail to commit if committer is anonymous
authorSimon McVittie <smcv@debian.org>
Sat, 24 Dec 2016 14:35:01 +0000 (14:35 +0000)
committerSimon McVittie <smcv@debian.org>
Wed, 28 Dec 2016 21:32:12 +0000 (21:32 +0000)
IkiWiki/Plugin/git.pm
debian/changelog

index 331b48fda4e5b9f61b44452eabb91818aed9817e..aef0c6cb1d13a38d9d3195519185f143e18f7318 100644 (file)
@@ -600,18 +600,24 @@ sub rcs_commit_helper (@) {
                elsif (defined $params{session}->remote_addr()) {
                        $u=$params{session}->remote_addr();
                }
-               if (defined $u) {
+               if (length $u) {
                        $u=encode_utf8(IkiWiki::cloak($u));
                        $ENV{GIT_AUTHOR_NAME}=$u;
                }
+               else {
+                       $u = 'anonymous';
+               }
                if (defined $params{session}->param("nickname")) {
                        $u=encode_utf8($params{session}->param("nickname"));
                        $u=~s/\s+/_/g;
                        $u=~s/[^-_0-9[:alnum:]]+//g;
                }
-               if (defined $u) {
+               if (length $u) {
                        $ENV{GIT_AUTHOR_EMAIL}="$u\@web";
                }
+               else {
+                       $ENV{GIT_AUTHOR_EMAIL}='anonymous@web';
+               }
        }
 
        ensure_committer();
index 422876e3c71160847e5354f4f309ed7345d899a0..86d06bdc664beca79a80261e875392e3d54eceb9 100644 (file)
@@ -3,6 +3,8 @@ ikiwiki (3.20161220) UNRELEASED; urgency=medium
   * Add CVE references for CVE-2016-10026
   * Add missing ikiwiki.setup for the manual test for CVE-2016-10026
   * git: don't issue a warning if the rcsinfo CGI parameter is undefined
+  * git: do not fail to commit changes with a recent git version
+    and an anonymous committer
 
  -- Simon McVittie <smcv@debian.org>  Wed, 21 Dec 2016 13:03:07 +0000