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
a67a096a
Commit
a67a096a
authored
Dec 17, 2010
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added creation of 'objects' and 'refs' directories.
parent
58fcfc26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
src/repository.c
+15
-0
No files found.
src/repository.c
View file @
a67a096a
...
...
@@ -35,6 +35,7 @@
#define GIT_FOLDER "/.git/"
#define GIT_OBJECTS_FOLDER "objects/"
#define GIT_REFS_FOLDER "refs/"
#define GIT_INDEX_FILE "index"
#define GIT_HEAD_FILE "HEAD"
...
...
@@ -742,9 +743,14 @@ int git_repository_init__create_structure(git_repository_init_results* results)
{
char
temp_path
[
GIT_PATH_MAX
];
int
path_len
;
const
int
mode
=
0755
;
/* or 0777 ? */
char
*
git_dir
=
results
->
path_repository
;
//TODO : Ensure the parent tree structure already exists by recursively building it through gitfo_mkdir_recurs().
if
(
gitfo_mkdir_recurs
(
git_dir
,
mode
))
return
GIT_ERROR
;
path_len
=
strlen
(
git_dir
);
strcpy
(
temp_path
,
git_dir
);
...
...
@@ -755,6 +761,15 @@ int git_repository_init__create_structure(git_repository_init_results* results)
return
git_repository_init__reinit
(
results
);
}
strcpy
(
temp_path
+
path_len
,
GIT_OBJECTS_FOLDER
);
if
(
gitfo_mkdir
(
temp_path
,
mode
))
return
GIT_ERROR
;
strcpy
(
temp_path
+
path_len
,
GIT_REFS_FOLDER
);
if
(
gitfo_mkdir
(
temp_path
,
mode
))
return
GIT_ERROR
;
/* To be implemented */
return
GIT_SUCCESS
;
...
...
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