Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: git-gui 0.12 git-gui: Get rid of the last remnants of GIT_CONFIG_LOCAL git-gui: Update Hungarian translation for 0.12 git-gui: Fixed typos in Swedish translation. git-gui: Updated Swedish translation (515t0f0u). git gui: update Italian translation git-gui: Update Japanese translation for 0.12 git-gui: Starting translation for Norwegian git-gui: Update German (completed) translation. git-gui: Update po template to include 'Mirroring %s' message git-gui: Fix commit encoding handling. git-gui: Fix handling of relative paths in blame.
This commit is contained in:
@ -2630,6 +2630,20 @@ proc usage {} {
|
||||
exit 1
|
||||
}
|
||||
|
||||
proc normalize_relpath {path} {
|
||||
set elements {}
|
||||
foreach item [file split $path] {
|
||||
if {$item eq {.}} continue
|
||||
if {$item eq {..} && [llength $elements] > 0
|
||||
&& [lindex $elements end] ne {..}} {
|
||||
set elements [lrange $elements 0 end-1]
|
||||
continue
|
||||
}
|
||||
lappend elements $item
|
||||
}
|
||||
return [eval file join $elements]
|
||||
}
|
||||
|
||||
# -- Not a normal commit type invocation? Do that instead!
|
||||
#
|
||||
switch -- $subcommand {
|
||||
@ -2648,7 +2662,7 @@ blame {
|
||||
foreach a $argv {
|
||||
if {$is_path || [file exists $_prefix$a]} {
|
||||
if {$path ne {}} usage
|
||||
set path $_prefix$a
|
||||
set path [normalize_relpath $_prefix$a]
|
||||
break
|
||||
} elseif {$a eq {--}} {
|
||||
if {$path ne {}} {
|
||||
@ -2671,7 +2685,7 @@ blame {
|
||||
unset is_path
|
||||
|
||||
if {$head ne {} && $path eq {}} {
|
||||
set path $_prefix$head
|
||||
set path [normalize_relpath $_prefix$head]
|
||||
set head {}
|
||||
}
|
||||
|
||||
@ -3315,7 +3329,6 @@ by %s:
|
||||
{^GIT_PAGER$} -
|
||||
{^GIT_TRACE$} -
|
||||
{^GIT_CONFIG$} -
|
||||
{^GIT_CONFIG_LOCAL$} -
|
||||
{^GIT_(AUTHOR|COMMITTER)_DATE$} {
|
||||
append msg " - $name\n"
|
||||
incr ignored_env
|
||||
|
||||
Reference in New Issue
Block a user