diff options
author | Paulo Gomes <pjbgf@linux.com> | 2024-07-13 10:11:01 +0100 |
---|---|---|
committer | Paulo Gomes <pjbgf@linux.com> | 2024-07-13 10:11:01 +0100 |
commit | 9550dfab10f009362b4921bc7f45996d9ff6ce5e (patch) | |
tree | 25d82cfcfe1aebfef27d301c28a8bf72993ffd11 /plumbing/transport/common.go | |
parent | 94fb0d8e1a77fd962c0dde4bed08ce59bc5cfba2 (diff) | |
download | go-git-9550dfab10f009362b4921bc7f45996d9ff6ce5e.tar.gz |
plumbing: transport/file, Change paths to absolute
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
Diffstat (limited to 'plumbing/transport/common.go')
-rw-r--r-- | plumbing/transport/common.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plumbing/transport/common.go b/plumbing/transport/common.go index b05437f..fae1aa9 100644 --- a/plumbing/transport/common.go +++ b/plumbing/transport/common.go @@ -19,6 +19,7 @@ import ( "fmt" "io" "net/url" + "path/filepath" "strconv" "strings" @@ -295,7 +296,11 @@ func parseFile(endpoint string) (*Endpoint, bool) { return nil, false } - path := endpoint + path, err := filepath.Abs(endpoint) + if err != nil { + return nil, false + } + return &Endpoint{ Protocol: "file", Path: path, |