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
dde6d9c7
Commit
dde6d9c7
authored
Sep 10, 2019
by
Laurence McGlashan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
open:move all cleanup code to cleanup label in git_repository_open_ext
parent
b545be3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
src/repository.c
+7
-9
No files found.
src/repository.c
View file @
dde6d9c7
...
...
@@ -800,7 +800,7 @@ int git_repository_open_ext(
unsigned
is_worktree
;
git_buf
gitdir
=
GIT_BUF_INIT
,
workdir
=
GIT_BUF_INIT
,
gitlink
=
GIT_BUF_INIT
,
commondir
=
GIT_BUF_INIT
;
git_repository
*
repo
;
git_repository
*
repo
=
NULL
;
git_config
*
config
=
NULL
;
if
(
flags
&
GIT_REPOSITORY_OPEN_FROM_ENV
)
...
...
@@ -812,13 +812,8 @@ int git_repository_open_ext(
error
=
find_repo
(
&
gitdir
,
&
workdir
,
&
gitlink
,
&
commondir
,
start_path
,
flags
,
ceiling_dirs
);
if
(
error
<
0
||
!
repo_ptr
)
{
git_buf_dispose
(
&
gitdir
);
git_buf_dispose
(
&
workdir
);
git_buf_dispose
(
&
gitlink
);
git_buf_dispose
(
&
commondir
);
return
error
;
}
if
(
error
<
0
||
!
repo_ptr
)
goto
cleanup
;
repo
=
repository_alloc
();
GIT_ERROR_CHECK_ALLOC
(
repo
);
...
...
@@ -864,11 +859,14 @@ int git_repository_open_ext(
cleanup:
git_buf_dispose
(
&
gitdir
);
git_buf_dispose
(
&
workdir
);
git_buf_dispose
(
&
gitlink
);
git_buf_dispose
(
&
commondir
);
git_config_free
(
config
);
if
(
error
<
0
)
git_repository_free
(
repo
);
else
if
(
repo_ptr
)
*
repo_ptr
=
repo
;
return
error
;
...
...
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