author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | |
Sat, 23 Jan 2010 10:03:35 +0000 (11:03 +0100) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 23 Jan 2010 23:14:21 +0000 (15:14 -0800) | ||
commit | 29e5573d1ef67c92314c39e55d26504fee119c04 | |
tree | 49d765fd396462b806d7bfc62839a65fd48873ab | tree | snapshot |
parent | 21985a11360fc845b73f8300a8739b7b073f0627 | commit | diff |
git-gui: handle bare repos correctly
Refactor checking for a bare repository into its own proc, that relies
on git rev-parse --is-bare-repository if possible. For older versions of
git we fall back to a logic such that the repository is considered bare
if:
* either the core.bare setting is true
* or the worktree is not set and the directory name ends with .git
The error message for the case of an unhandled bare repository is also
updated to reflect the fact that the problem is not the funny name but
the bareness.
The new refactored proc is also used to disable the menu entry to
explore the working copy, and to skip changing to the worktree before
the gitk invocation.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Refactor checking for a bare repository into its own proc, that relies
on git rev-parse --is-bare-repository if possible. For older versions of
git we fall back to a logic such that the repository is considered bare
if:
* either the core.bare setting is true
* or the worktree is not set and the directory name ends with .git
The error message for the case of an unhandled bare repository is also
updated to reflect the fact that the problem is not the funny name but
the bareness.
The new refactored proc is also used to disable the menu entry to
explore the working copy, and to skip changing to the worktree before
the gitk invocation.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | diff | blob | history |