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
ddc9e79a
Commit
ddc9e79a
authored
Feb 02, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more issues with Win32 EOL
Signed-off-by: Vicent Marti <tanoku@gmail.com>
parent
ff5873ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
src/refs.c
+12
-5
src/refs.h
+1
-1
No files found.
src/refs.c
View file @
ddc9e79a
...
...
@@ -95,7 +95,7 @@ int git_reference_new(git_reference **ref_out, git_repository *repo)
static
int
parse_sym_ref
(
git_reference
*
ref
,
gitfo_buf
*
file_content
)
{
const
int
header_len
=
strlen
(
GIT_SYMREF
);
const
unsigned
int
header_len
=
strlen
(
GIT_SYMREF
);
const
char
*
refname_start
;
char
*
eol
;
...
...
@@ -318,10 +318,6 @@ static int parse_packed_line(
goto
cleanup
;
}
/* windows line feeds */
if
(
refname_end
[
-
1
]
==
'\r'
)
refname_end
--
;
refname_len
=
refname_end
-
refname_begin
;
ref
->
name
=
git__malloc
(
refname_len
+
1
);
...
...
@@ -333,6 +329,9 @@ static int parse_packed_line(
memcpy
(
ref
->
name
,
refname_begin
,
refname_len
);
ref
->
name
[
refname_len
]
=
0
;
if
(
ref
->
name
[
refname_len
-
1
]
==
'\r'
)
ref
->
name
[
refname_len
-
1
]
=
0
;
ref
->
type
=
GIT_REF_OID
;
ref
->
packed
=
1
;
...
...
@@ -368,6 +367,14 @@ static int parse_packed_refs(git_refcache *ref_cache, git_repository *repo)
/* Let's skip the header */
buffer_start
+=
strlen
(
GIT_PACKEDREFS_HEADER
);
if
(
*
buffer_start
==
'\r'
)
buffer_start
++
;
if
(
*
buffer_start
!=
'\n'
)
return
GIT_EPACKEDREFSCORRUPTED
;
buffer_start
++
;
while
(
buffer_start
<
buffer_end
)
{
git_reference
*
ref
=
NULL
;
...
...
src/refs.h
View file @
ddc9e79a
...
...
@@ -11,7 +11,7 @@
#define GIT_SYMREF "ref: "
#define GIT_PACKEDREFS_FILE "packed-refs"
#define GIT_PACKEDREFS_HEADER "# pack-refs with: peeled
\n
"
#define GIT_PACKEDREFS_HEADER "# pack-refs with: peeled "
#define MAX_GITDIR_TREE_STRUCTURE_PATH_LENGTH 100
struct
git_reference
{
...
...
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