author | Alexander Gavrilov <angavrilov@gmail.com> | |
Sat, 6 Dec 2008 17:21:54 +0000 (20:21 +0300) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 8 Dec 2008 16:33:05 +0000 (08:33 -0800) | ||
commit | 95e706b5ec4d9b6832640c717c98fb4c912b54c5 | |
tree | 224912b2912bf41a89c2bb3c11a6f7be1f4f670c | tree | snapshot |
parent | 861c68e3b6a8d10af5517e6750a66407d32105aa | commit | diff |
git-gui: Fix handling of relative paths in blame.
Currently using '..' or '.' in the file path for gui blame
causes it to break, because the path is passed inside the
SHA:PATH spec to cat-file, which apparently does not understand
such items. As a result, cat-file returns nothing, and the
viewer crashes because of an "index out of range" error.
This commit adds a simple function that normalizes such paths.
I choose not to use [file normalize], because it uses some data
from the file system, e.g. dereferences symlinks, and creates
an absolute path, while blame may be used to inspect historical
information that bears no relation to the current filesystem state.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Currently using '..' or '.' in the file path for gui blame
causes it to break, because the path is passed inside the
SHA:PATH spec to cat-file, which apparently does not understand
such items. As a result, cat-file returns nothing, and the
viewer crashes because of an "index out of range" error.
This commit adds a simple function that normalizes such paths.
I choose not to use [file normalize], because it uses some data
from the file system, e.g. dereferences symlinks, and creates
an absolute path, while blame may be used to inspect historical
information that bears no relation to the current filesystem state.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | diff | blob | history |