Handle post-review from a detached HEAD using git

Review Request #2985 — Created March 19, 2012 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

Handle post-review from a detached HEAD using git

When running from a detached HEAD (not on a branch), post-review fails after a call to git symbolic-ref.
[nmorey@sat:db ((f8dcfa9...) $)]$ post-review --guess-summary --guess-description --parent=HEAD~1
Failed to execute command: ['git', 'symbolic-ref', '-q', 'HEAD']

However we do not need to be on a branch to have the script working.
So this patch ignores errors from git symbolic-ref and add tests for self.head_ref being not set.

Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>