summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Bert Wesarg <bert.wesarg@googlemail.com>2011-10-14 10:14:49 +0200
committerLibravatar Pat Thoyts <patthoyts@users.sourceforge.net>2011-10-18 09:27:28 +0100
commit12b219f7f95f2d089e49140dcb1c2dd6259ff5cf (patch)
tree51a072ed6a5ab1ad515761f978becbd95666d471
parentgit-gui: fix multi selected file operation (diff)
downloadtgif-12b219f7f95f2d089e49140dcb1c2dd6259ff5cf.tar.xz
git-gui: handle config booleans without value
When git interprets a config variable without a value as bool it is considered as true. But git-gui doesn't so until yet. The value for boolean configs are also case-insensitive. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
-rwxr-xr-xgit-gui.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/git-gui.sh b/git-gui.sh
index e5dd8bc1f2..33ab5dc3d6 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -299,7 +299,9 @@ proc is_config_true {name} {
global repo_config
if {[catch {set v $repo_config($name)}]} {
return 0
- } elseif {$v eq {true} || $v eq {1} || $v eq {yes}} {
+ }
+ set v [string tolower $v]
+ if {$v eq {} || $v eq {true} || $v eq {1} || $v eq {yes} || $v eq {on}} {
return 1
} else {
return 0
@@ -310,7 +312,9 @@ proc is_config_false {name} {
global repo_config
if {[catch {set v $repo_config($name)}]} {
return 0
- } elseif {$v eq {false} || $v eq {0} || $v eq {no}} {
+ }
+ set v [string tolower $v]
+ if {$v eq {false} || $v eq {0} || $v eq {no} || $v eq {off}} {
return 1
} else {
return 0
@@ -1060,6 +1064,10 @@ git-version proc _parse_config {arr_name args} {
} else {
set arr($name) $value
}
+ } elseif {[regexp {^([^\n]+)$} $line line name]} {
+ # no value given, but interpreting them as
+ # boolean will be handled as true
+ set arr($name) {}
}
}
}
@@ -1075,6 +1083,10 @@ git-version proc _parse_config {arr_name args} {
} else {
set arr($name) $value
}
+ } elseif {[regexp {^([^=]+)$} $line line name]} {
+ # no value given, but interpreting them as
+ # boolean will be handled as true
+ set arr($name) {}
}
}
close $fd_rc