```python
Check the number of commits that would be pushed upstream

Args:
folder (`str` or `Path`):
The folder in which to run the command.
upstream (`str`, *optional*):
The name of the upstream repository with which the comparison should be
made.

Returns:
`int`: Number of commits that would be pushed upstream were a `git
push` to proceed.
```