Skip to content

Commit

Permalink
instaweb: use 'browser.<tool>.path' config option if it's set.
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Couder <[email protected]>
Acked-by: Eric Wong <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
chriscool authored and gitster committed Jan 29, 2008
1 parent f7ff09d commit ab989ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ branch.<name>.rebase::

browser.<tool>.path::
Override the path for the given tool that may be used to
browse HTML help. See '-w' option in linkgit:git-help[1].
browse HTML help (see '-w' option in linkgit:git-help[1]) or a
working repository in gitweb (see linkgit:git-instaweb[1]).

clean.requireForce::
A boolean to make git-clean do nothing unless given -f
Expand Down
10 changes: 9 additions & 1 deletion git-instaweb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ webrick)
;;
esac

init_browser_path() {
browser_path="`git config browser.$1.path`"
test -z "$browser_path" && browser_path="$1"
}

start_httpd
url=http://127.0.0.1:$port
test -n "$browser" && "$browser" $url || echo $url
test -n "$browser" && {
init_browser_path "$browser"
"$browser_path" $url
} || echo $url

0 comments on commit ab989ad

Please sign in to comment.