Diff: Fixed staged file diff in a commit-less repo
When there is no commit in the repo, there is no HEAD revision.
Therefore the diff command returns an error (fatal: bad revision
'head'), and git-cola then use empty text as the diff fallback.
To fix the issue, the diff_helper is updated to check if `ref` exists,
and if `ref` doesn't exist, we drop it and not pass it to the git diff.
The check is done through the rev_parse wrapper in gitcmds,
which will simply return back `ref`, when it is not in git.
When viewing the diff of a staged file in a commit-less repo,
the ref would be 'HEAD'. Dropping 'HEAD' from parameter will make git
compare the staged file against file in the working directory.
Issue: #1110
Reported-By: kyanres
Signed-off-by: mmargoliono