summary refs log tree commit diff stats
path: root/compiler/docgen.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-09-15 09:27:51 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-09-15 09:27:51 +0200
commit39f0195ebf30cc9f4b96953423298d7a2130eac8 (patch)
treebb4daf580c239b59d232e186814b69fc642ce6d5 /compiler/docgen.nim
parentbc738d63a728ee6030cc224c8808990a6f641feb (diff)
parent2ef65d5cdf3d65cbfab4c39796ddb4e70e9ebb37 (diff)
downloadNim-39f0195ebf30cc9f4b96953423298d7a2130eac8.tar.gz
Merge branch 'devel' into araq
Diffstat (limited to 'compiler/docgen.nim')
-rw-r--r--compiler/docgen.nim14
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index 26dd889ce..3f4f7b164 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -462,12 +462,14 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) =
     var path = n.info.toFullPath
     if path.startsWith(cwd):
       path = path[cwd.len+1 .. ^1].replace('\\', '/')
-    var commit = getConfigVar("git.commit")
-    if commit.len == 0: commit = "master"
-    dispA(seeSrcRope, "$1", "", [ropeFormatNamedVars(docItemSeeSrc,
-        ["path", "line", "url", "commit"], [rope path,
-        rope($n.info.line), rope getConfigVar("git.url"),
-        rope commit])])
+    let gitUrl = getConfigVar("git.url")
+    if gitUrl.len > 0:
+      var commit = getConfigVar("git.commit")
+      if commit.len == 0: commit = "master"
+      dispA(seeSrcRope, "$1", "", [ropeFormatNamedVars(docItemSeeSrc,
+          ["path", "line", "url", "commit"], [rope path,
+          rope($n.info.line), rope gitUrl,
+          rope commit])])
 
   add(d.section[k], ropeFormatNamedVars(getConfigVar("doc.item"),
     ["name", "header", "desc", "itemID", "header_plain", "itemSym",