summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2017-08-03 22:56:22 +0100
committerGitHub <noreply@github.com>2017-08-03 22:56:22 +0100
commitd60da4f8f08676f51fa6dffece35bfe8800d4ae6 (patch)
treecdf4bc249bce2f50ec0015b955f4e53d09fed295 /compiler
parentfed1b0a0774e6b0b301fbe11cea70dbd0eac2c19 (diff)
parent606aab9cdf6d846ac5633a769ab0adaf6b960a6b (diff)
downloadNim-d60da4f8f08676f51fa6dffece35bfe8800d4ae6.tar.gz
Merge pull request #6165 from endragor/no-source-without-git
Do not generate Source/Edit without git in config
Diffstat (limited to 'compiler')
-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",