summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-10-12 04:54:15 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-10-12 04:54:15 (GMT)
commit85f7a94b3c1e4289827f2529d2e8447f3678c619 (patch)
tree07b4342c17673e451fa2a64e11360d009a413a85 /git-gui.sh
parentf00d504a6fcf29944311a497d0eb76f0fe5ef8f0 (diff)
downloadgit-85f7a94b3c1e4289827f2529d2e8447f3678c619.zip
git-85f7a94b3c1e4289827f2529d2e8447f3678c619.tar.gz
git-85f7a94b3c1e4289827f2529d2e8447f3678c619.tar.bz2
git-gui: Support LFs embedded in config file values
Using the new --null option added to git-config in git 1.5.3 we can safely accept LFs that are embedded in configuration options. This does require a completely different configuration file parser then the pre 1.5.3 version as we are splitting on very different values. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/git-gui.sh b/git-gui.sh
index cfed62d..a6e2d57 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -749,6 +749,26 @@ unset -nocomplain idx fd
## config file parsing
git-version proc _parse_config {arr_name args} {
+ >= 1.5.3 {
+ upvar $arr_name arr
+ array unset arr
+ set buf {}
+ catch {
+ set fd_rc [eval [list git_read config --null --list] $args]
+ fconfigure $fd_rc -translation binary
+ set buf [read $fd_rc]
+ close $fd_rc
+ }
+ foreach line [split $buf "\0"] {
+ if {[regexp {^([^\n]+)\n(.*)$} $line line name value]} {
+ if {[is_many_config $name]} {
+ lappend arr($name) $value
+ } else {
+ set arr($name) $value
+ }
+ }
+ }
+ }
default {
upvar $arr_name arr
array unset arr