Return revision from switch_revision()

The revision we successfully switched to should be used when calling
git-buildpackage. That way we have a valid revision to use instead of
unconditionally prepending 'origin/'.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Improve efficiency of stdout handling in safe_run()

Roman Neuhauser suggested (for tar_scm) this improvement in handling the
stdout from the subprocess.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Don't output ERROR() string twice

In case of an error the output appears twice. If the SystemExit exception
is catched it still appears in the logging system. This was confusing so
lets increase usability.

Signed-off-by: Jan Blunck <jblunck@infradead.org>