rebase: use output() instead of checkout -q

Just like in rebase -i, use the output() function to execute checkout
instead of directly executing checkout -q.  This has the advantage of
not suppressing a possible error message from checkout when verbosity is
requested.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
sha1_name: expose grab_nth_branch_switch()

wt-status.c:grab_1st_switch() contains a re-implementation of the
parsing logic in grab_nth_branch_switch().  As a first step towards
cleaning up this duplication, expose grab_nth_branch_switch() and the
struct grab_nth_branch_switch_cbdata via cache.h.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
wt-status: remove unused field in grab_1st_switch_cbdata

The struct grab_1st_switch_cbdata has the field "found", which is set in
grab_1st_switch() when a match is found.  This information is redundant
and unused by any caller: the return value of the function serves to
communicate this information anyway.  Remove the field.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
checkout: respect GIT_REFLOG_ACTION

GIT_REFLOG_ACTION is an environment variable specifying the reflog
message to write after an action is completed.  Several other commands
including merge, reset, and commit respect it.

Fix the failing tests in t/checkout-last by making checkout respect it
too.  You can now expect

  $ git checkout -

to work as expected after any rebase operation.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>