@matheusbsbs / matheus-bagliano / commits / ab989adf6a
Fork 0

instaweb: use 'browser.<tool>.path' config option if it's set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Jan 29, 2008 at 07:08 UTC ab989adf6ab32fb80fd42cc95ed0eacb029258fe
2 files changed +11 -2
Documentation/config.txt
+2 -1
@@ -369,7 +369,8 @@ branch.<name>.rebase::
369
370 browser.<tool>.path::
371 Override the path for the given tool that may be used to
372 - browse HTML help. See '-w' option in linkgit:git-help[1].
372 + browse HTML help (see '-w' option in linkgit:git-help[1]) or a
373 + working repository in gitweb (see linkgit:git-instaweb[1]).
374
375 clean.requireForce::
376 A boolean to make git-clean do nothing unless given -f
git-instaweb.sh
+9 -1
@@ -274,6 +274,14 @@ webrick)
274 ;;
275 esac
276
277 +init_browser_path() {
278 + browser_path="`git config browser.$1.path`"
279 + test -z "$browser_path" && browser_path="$1"
280 +}
281 +
282 start_httpd
283 url=http://127.0.0.1:$port
279 -test -n "$browser" && "$browser" $url || echo $url
284 +test -n "$browser" && {
285 + init_browser_path "$browser"
286 + "$browser_path" $url
287 +} || echo $url