Refactored: Move fast-forward code to a separate function

Signed-off-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw>
Fix: Rebase dialog can not abort

For fast-forward situation, the checkout command is the first running one of all.
When running it failed, the status can be restored simply by making m_OrigUpstreamHash empty.
And it is needed for aborting rebase dialog.

Signed-off-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw>