Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
fed98153
Commit
fed98153
authored
Jan 17, 2014
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2058 from libgit2/rb/gitdir-windows-paths
Convert gitdir paths to posix on Windows
parents
b6815fe0
6b415f62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
src/repository.c
+5
-1
No files found.
src/repository.c
View file @
fed98153
...
...
@@ -289,16 +289,20 @@ static int read_gitfile(git_buf *path_out, const char *file_path)
return
-
1
;
git_buf_rtrim
(
&
file
);
/* apparently on Windows, some people use backslashes in paths */
git_path_mkposix
(
file
.
ptr
);
if
(
git_buf_len
(
&
file
)
<=
prefix_len
||
memcmp
(
git_buf_cstr
(
&
file
),
GIT_FILE_CONTENT_PREFIX
,
prefix_len
)
!=
0
)
{
giterr_set
(
GITERR_REPOSITORY
,
"The `.git` file at '%s' is malformed"
,
file_path
);
giterr_set
(
GITERR_REPOSITORY
,
"The `.git` file at '%s' is malformed"
,
file_path
);
error
=
-
1
;
}
else
if
((
error
=
git_path_dirname_r
(
path_out
,
file_path
))
>=
0
)
{
const
char
*
gitlink
=
git_buf_cstr
(
&
file
)
+
prefix_len
;
while
(
*
gitlink
&&
git__isspace
(
*
gitlink
))
gitlink
++
;
error
=
git_path_prettify_dir
(
path_out
,
gitlink
,
git_buf_cstr
(
path_out
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment