diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-01-23 11:03:34 +0100 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-01-23 15:14:21 -0800 |
commit | 21985a11360fc845b73f8300a8739b7b073f0627 (patch) | |
tree | da252d457d1fb7dc95d44f552aaf6611fa3fc03b /lib/branch_delete.tcl | |
parent | git-gui: Support applying a range of changes at once (diff) | |
download | tgif-21985a11360fc845b73f8300a8739b7b073f0627.tar.xz |
git-gui: handle non-standard worktree locations
Don't rely on the git worktree being the updir of the gitdir, since it
might not be. Instead, define (and use) a new _gitworktree global
variable, setting it to $GIT_WORK_TREE if present, falling back to
core.worktree if defined, and finally to whatever we guess the correct
worktree is. Getting core.worktree requires the config from the alleged
git dir _gitdir to be loaded early.
Supporting non-standard worktree locations also breaks the git-gui
assumption (made when calling gitk) that the worktree was the dirname of
$_gitdir and that, by consequence, the git dir could be set to the tail
of $_gitdir once we changed to the worktree root directory. Therefore,
we need to export a GIT_DIR environment variable set to the full,
normalized path of $_gitdir instead. We also skip changing to the worktree
directory if it's empty (i.e. if we're working on a bare repository).
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/branch_delete.tcl')
0 files changed, 0 insertions, 0 deletions