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
7c32a0b5
Commit
7c32a0b5
authored
Jan 31, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1300 from carlosmn/ref-leading-slash
Crash when resolving a ref starting with "/"
parents
5f9f69d9
e5ef0f18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
src/refs.c
+5
-0
tests-clar/refs/isvalidname.c
+2
-0
No files found.
src/refs.c
View file @
7c32a0b5
...
...
@@ -1691,6 +1691,11 @@ int git_reference__normalize_name(
segments_count
++
;
}
/* This means that there's a leading slash in the refname */
if
(
segment_len
==
0
&&
segments_count
==
0
)
{
goto
cleanup
;
}
if
(
current
[
segment_len
]
==
'\0'
)
break
;
...
...
tests-clar/refs/isvalidname.c
View file @
7c32a0b5
...
...
@@ -10,6 +10,8 @@ void test_refs_isvalidname__can_detect_invalid_formats(void)
cl_assert_equal_i
(
false
,
git_reference_is_valid_name
(
"_NO_LEADING_UNDERSCORE"
));
cl_assert_equal_i
(
false
,
git_reference_is_valid_name
(
"HEAD/aa"
));
cl_assert_equal_i
(
false
,
git_reference_is_valid_name
(
"lower_case"
));
cl_assert_equal_i
(
false
,
git_reference_is_valid_name
(
"/stupid/name/master"
));
cl_assert_equal_i
(
false
,
git_reference_is_valid_name
(
"/"
));
cl_assert_equal_i
(
false
,
git_reference_is_valid_name
(
""
));
}
...
...
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