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
0283fc46
Commit
0283fc46
authored
May 16, 2018
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
path: provide a generic dogit checking function for HFS
This lets us check for other kinds of reserved files.
parent
397abe98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
src/path.c
+19
-6
No files found.
src/path.c
View file @
0283fc46
...
...
@@ -1561,18 +1561,31 @@ static int32_t next_hfs_char(const char **in, size_t *len)
return
0
;
/* NULL byte -- end of string */
}
static
bool
verify_dotgit_hfs
(
const
char
*
path
,
size_t
len
)
static
bool
verify_dotgit_hfs
_generic
(
const
char
*
path
,
size_t
len
,
const
char
*
needle
,
size_t
needle_
len
)
{
if
(
next_hfs_char
(
&
path
,
&
len
)
!=
'.'
||
next_hfs_char
(
&
path
,
&
len
)
!=
'g'
||
next_hfs_char
(
&
path
,
&
len
)
!=
'i'
||
next_hfs_char
(
&
path
,
&
len
)
!=
't'
||
next_hfs_char
(
&
path
,
&
len
)
!=
0
)
size_t
i
;
char
c
;
if
(
next_hfs_char
(
&
path
,
&
len
)
!=
'.'
)
return
true
;
for
(
i
=
0
;
i
<
needle_len
;
i
++
)
{
c
=
next_hfs_char
(
&
path
,
&
len
);
if
(
c
!=
needle
[
i
])
return
true
;
}
if
(
next_hfs_char
(
&
path
,
&
len
)
!=
'\0'
)
return
true
;
return
false
;
}
static
bool
verify_dotgit_hfs
(
const
char
*
path
,
size_t
len
)
{
return
verify_dotgit_hfs_generic
(
path
,
len
,
"git"
,
CONST_STRLEN
(
"git"
));
}
GIT_INLINE
(
bool
)
verify_dotgit_ntfs
(
git_repository
*
repo
,
const
char
*
path
,
size_t
len
)
{
git_buf
*
reserved
=
git_repository__reserved_names_win32
;
...
...
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