on master help sign in
Fix thunk URI parsing for real now

- Don't parse relative URIs for git remotes - Only disambuigate between paths and scp-style shorthand once full URI is ruled out.

commita0cfbc7a953a1e47c7df5144d2dbeba4a24fc974 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateWed 17 Oct 2018, 16:46 (8 years ago) parent9d928af
1 file changed+7−1
lib/command/src/Obelisk/Command/Thunk.hs+7−1
lib/command/src/Obelisk/Command/Thunk.hs+7−1
@@ -875,7 +875,13 @@ gitGetCommitBranch uri mbranch = withExitFailMessage ("Failure for git remote "
875875 uriMsg = render uri
876876
877877parseGitUri :: Text -> Maybe URI
878−parseGitUri x = parseSshShorthand x <|> mkURI x
878+parseGitUri x = parseAbsoluteURI x <|> parseSshShorthand x
879+
880+parseAbsoluteURI :: Text -> Maybe URI
881+parseAbsoluteURI uri = do
882+ parsedUri <- mkURI uri
883+ guard $ isPathAbsolute parsedUri
884+ pure $ parsedUri
879885
880886parseSshShorthand :: Text -> Maybe URI
881887parseSshShorthand uri = do