Would be best to turn all this into:

```php
$record['extra']['git']['branch'] = $branch;
$record['extra']['git']['commit'] = $commit;
```

Less code, less function calls, and less copying data around :)