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
28990938
Commit
28990938
authored
Dec 17, 2010
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prettified HEAD symlink generation.
parent
d13e7e02
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
src/repository.c
+10
-2
No files found.
src/repository.c
View file @
28990938
...
...
@@ -39,6 +39,10 @@
#define GIT_INDEX_FILE "index"
#define GIT_HEAD_FILE "HEAD"
#define GIT_SYMREF "ref: "
#define GIT_REFS_HEADS "refs/heads/"
#define GIT_BRANCH_MASTER "master"
static
const
int
default_table_size
=
32
;
static
const
double
max_load_factor
=
0
.
65
;
...
...
@@ -743,11 +747,15 @@ int git_repository_init__create_head(const char* head_path)
{
git_file
fd
;
int
error
=
GIT_SUCCESS
;
const
char
*
head_content
=
"ref: refs/heads/master
\n
"
;
char
head_symlink
[
50
];
int
len
;
len
=
sprintf
(
head_symlink
,
"%s %s%s
\n
"
,
GIT_SYMREF
,
GIT_REFS_HEADS
,
GIT_BRANCH_MASTER
);
if
((
fd
=
gitfo_creat
(
head_path
,
S_IREAD
|
S_IWRITE
))
<
0
)
return
GIT_ERROR
;
error
=
gitfo_write
(
fd
,
(
void
*
)
head_
content
,
strlen
(
head_content
));
error
=
gitfo_write
(
fd
,
(
void
*
)
head_
symlink
,
strlen
(
head_symlink
));
if
(
error
<
GIT_SUCCESS
)
goto
cleanup
;
...
...
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