Teach "git branch" about --new-workdir
Inspired by contrib/workdir/git-new-workdir, the flag --new-workdir (or
its shortcut, -n) can be used to create a new working directory for the
newly created branch. All information, except which branch is checked
out (and therefore also the index), will be symlinked from the current
repository.
Example:
$ git branch -n ~/my-new-topic xy-problem
will create a branch called "xy-problem", which is initially identical
to the current branch, and check out the new branch in ~/my-new-topic/.
You will be able to cherry-pick from, log and diff with the branch
"xy-problem" in the current repository, since most of the metadata is
shared.
Conversely, you can access all the branches in the current repository
from ~/my-new-topic/, too.
A word of warning: switching to _same_ branch that is checked out in
the other repository is asking for trouble. You are really working not
only on the same object database, but also the same (i.e. not copied)
refs namespace.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>