summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-05-09 01:58:25 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-05-09 01:58:25 (GMT)
commitc6127856eb318157121b0aeab150c074e9eeb3de (patch)
treedc7890d2b6ad4ac991c6f8c61f23d519cca84721 /git-gui.sh
parent685caf9af672811b45ebeaaa299b8f9fbd743d82 (diff)
downloadgit-c6127856eb318157121b0aeab150c074e9eeb3de.zip
git-c6127856eb318157121b0aeab150c074e9eeb3de.tar.gz
git-c6127856eb318157121b0aeab150c074e9eeb3de.tar.bz2
git-gui: Use prefix if blame is run in a subdirectory
I think it was Andy Parkins who pointed out that git gui blame HEAD f does not work if f is in a subdirectory and we are currently running git-gui within that subdirectory. This is happening because we did not take the user's prefix into account when we computed the file path in the repository. We now assume the prefix as returned by rev-parse --show-prefix is valid and we use that during the command line blame subcommand when we apply the parameters. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 568c814..8f33f81 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -261,8 +261,14 @@ unset -nocomplain v _junk act_maj act_min req_maj req_min
##
## repository setup
-if { [catch {set _gitdir $env(GIT_DIR)}]
- && [catch {set _gitdir [git rev-parse --git-dir]} err]} {
+if {[catch {
+ set _gitdir $env(GIT_DIR)
+ set _prefix {}
+ }]
+ && [catch {
+ set _gitdir [git rev-parse --git-dir]
+ set _prefix [git rev-parse --show-prefix]
+ } err]} {
catch {wm withdraw .}
error_popup "Cannot find the git directory:\n\n$err"
exit 1
@@ -1590,7 +1596,7 @@ blame {
exit 1
}
set current_branch [lindex $argv 0]
- blame::new $current_branch [lindex $argv 1]
+ blame::new $current_branch $_prefix[lindex $argv 1]
return
}
citool -