From 3f272674b829ba251f4dfbf299ef54ddc7133020 Mon Sep 17 00:00:00 2001 From: Jarrad Hope Date: Mon, 25 Feb 2019 14:05:36 +0700 Subject: [PATCH] return path instead of gitDir, parseURL TODO --- src/crvc.nim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/crvc.nim b/src/crvc.nim index 149f760..e95a956 100644 --- a/src/crvc.nim +++ b/src/crvc.nim @@ -4,7 +4,7 @@ const gitEnv = "GIT_DIR" protocol = "crvc" -proc setup(gitEnv: string, protocol: string): (string, string, string, string) = +proc setup(gitEnv: string, protocol: string): (string, string, string) = # Checks the Environment and returns the git Working directory, the protocol, the remote and url if paramCount() < 2: @@ -24,15 +24,16 @@ proc setup(gitEnv: string, protocol: string): (string, string, string, string) = raise newException(OSError, fmt"{gitDir} does not appear to be a git repository") # Create our Working Directory if it doesn't exist - let path = joinPath(gitDir, protocol, remote) + let path = joinPath(gitDir, remote) if not existsDir(path): createDir(path) - return (gitDir, protocol, remote, url) # I don't like result, too immutable + # TODO process url and pass to processStdio parseUrl? + return (path, remote, url) proc processStdio (env: tuple): void = # Supports the Git Remote Helper stdio protocol # https://git-scm.com/docs/git-remote-helpers - let (gitDir, protocol, remote, url) = env + let (path, remote, url) = env while true: var