Description: Fix tests when the building user has no full name
 Since some time the build environment in pbuilder is such that the user
 running the build process lacks full name in its gecos information. This
 uncovered a bug in the tests, which do not handle this situation gracefuly.
 This patch fixes the tests that match the generated commit notifications with
 the expectations of the test is such a way as to mimic the behaviour of the
 code which generates the notifications, which takes care of the missing full
 name gracefuly.
Author: Damyan Ivanov <dmn@debian.org>
Origin: upstream
Bug-Debian: https://bugs.debian.org/769239

--- a/t/57-client-git-squash-tags.t
+++ b/t/57-client-git-squash-tags.t
@@ -181,7 +181,9 @@ push_ok;
 
 $commit = $c->describe_commit;
 
-TestBot->expect( "#test 03${TestBot::USER_NAME} (03${TestBot::USER})"
+TestBot->expect( "#test "
+        . ( $TestBot::USER_NAME ? "03${TestBot::USER_NAME} " : '' )
+        . "(03${TestBot::USER})"
         . ' 12test/06there'
         . ' Pushed 05tag-1, 05tag-2, 6 other tags and 05tag-9' );
 
--- a/t/54-client-git-squash.t
+++ b/t/54-client-git-squash.t
@@ -189,7 +189,8 @@ ok( !ref($commit), 'squashed commit is a
 
 my $commit_id = shift @{ $commits{master} };
 
-TestBot->expect( "#test 03${TestBot::USER_NAME} "
+TestBot->expect( "#test "
+        . ( $TestBot::USER_NAME ? "03${TestBot::USER_NAME} " : '' )
         . "(03${TestBot::USER}) 05master $commit_id "
         . "12test/06there 3 commits pushed, "
         . " 101 file changed, 032(+)" );
@@ -209,7 +210,9 @@ ok( defined($commit), 'squashed new bran
 ok( !ref($commit), 'squashed commit is a plain string' )
     or BAIL_OUT "will fail with $commit anyway";
 
-TestBot->expect( "#test 03${TestBot::USER_NAME} (03${TestBot::USER}) "
+TestBot->expect( "#test "
+        . ( $TestBot::USER_NAME ? "03${TestBot::USER_NAME} " : '' )
+        . "(03${TestBot::USER}) "
         . "05feature "
         . $commit_id
         . " 12test/06there New branch with 2 commits pushed, "
--- a/t/55-client-git-merges-ff.t
+++ b/t/55-client-git-merges-ff.t
@@ -214,7 +214,8 @@ is( $commit->branch, $b1 );
 is( $commit->log,    'fast forward' );
 
 TestBot->expect( "#test "
-        . "03${TestBot::USER_NAME} (03${TestBot::USER})"
+        . ( $TestBot::USER_NAME ? "03${TestBot::USER_NAME} " : '' )
+        . "(03${TestBot::USER})"
         . " 05develop "
         . $commit->id
         . " 12test/06there "
--- a/t/56-client-git-ff-merge-2.t
+++ b/t/56-client-git-ff-merge-2.t
@@ -198,7 +198,9 @@ is( $commit->branch, 'master' );
 is( $commit->id,     $c1 );
 is( $commit->log,    "fast forward" );
 
-TestBot->expect( "#test 03${TestBot::USER_NAME} (03${TestBot::USER}) 05master "
+TestBot->expect( "#test "
+        . ( $TestBot::USER_NAME ? "03${TestBot::USER_NAME} " : '' )
+        . "(03${TestBot::USER}) 05master "
         . $commit->id
         . ' 12test/06there fast forward * 14http://scm.host.org/there/master/?commit='
         . $commit->id
