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
6a9ef012
Commit
6a9ef012
authored
Mar 07, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1401 from carlosmn/leading-slash
refs: explicitly catch leading slashes
parents
9952f24e
bb45c57f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
src/refs.c
+3
-0
tests-clar/refs/lookup.c
+6
-0
No files found.
src/refs.c
View file @
6a9ef012
...
@@ -1667,6 +1667,9 @@ int git_reference__normalize_name(
...
@@ -1667,6 +1667,9 @@ int git_reference__normalize_name(
process_flags
=
flags
;
process_flags
=
flags
;
current
=
(
char
*
)
name
;
current
=
(
char
*
)
name
;
if
(
*
current
==
'/'
)
goto
cleanup
;
if
(
normalize
)
if
(
normalize
)
git_buf_clear
(
buf
);
git_buf_clear
(
buf
);
...
...
tests-clar/refs/lookup.c
View file @
6a9ef012
...
@@ -32,6 +32,12 @@ void test_refs_lookup__with_resolve(void)
...
@@ -32,6 +32,12 @@ void test_refs_lookup__with_resolve(void)
git_reference_free
(
a
);
git_reference_free
(
a
);
}
}
void
test_refs_lookup__invalid_name
(
void
)
{
git_oid
oid
;
cl_git_fail
(
git_reference_name_to_id
(
&
oid
,
g_repo
,
"/refs/tags/point_to_blob"
));
}
void
test_refs_lookup__oid
(
void
)
void
test_refs_lookup__oid
(
void
)
{
{
git_oid
tag
,
expected
;
git_oid
tag
,
expected
;
...
...
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