Return git exit codes from shell wrapper.

Shell wrapper should return non-zero exit code if git subprocess
was not successful.
Add tests for branch creation without parent.
Fix branch creation without parent.