Instead of providing a fallback to an empty string, how about checking for `None`?

```python
git_branch = settings.get('branch')
if branch is None:
  git_branch = git_stdout.replace(...)
```