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
c01b7841
Commit
c01b7841
authored
Jul 28, 2022
by
yuangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve error handling
parent
cfc2ae68
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
13 deletions
+7
-13
.gitignore
+0
-1
include/git2/repository.h
+0
-1
src/libgit2/grafts.c
+7
-3
src/libgit2/repository.c
+0
-7
src/libgit2/repository.h
+0
-1
No files found.
.gitignore
View file @
c01b7841
...
@@ -6,4 +6,3 @@
...
@@ -6,4 +6,3 @@
CMakeSettings.json
CMakeSettings.json
.vs
.vs
.idea
.idea
.cache
include/git2/repository.h
View file @
c01b7841
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
#include "types.h"
#include "types.h"
#include "oid.h"
#include "oid.h"
#include "buffer.h"
#include "buffer.h"
#include "oidarray.h"
/**
/**
* @file git2/repository.h
* @file git2/repository.h
...
...
src/libgit2/grafts.c
View file @
c01b7841
...
@@ -93,13 +93,17 @@ int git_grafts_refresh(git_grafts *grafts)
...
@@ -93,13 +93,17 @@ int git_grafts_refresh(git_grafts *grafts)
if
(
!
grafts
->
path
)
if
(
!
grafts
->
path
)
return
0
;
return
0
;
error
=
git_futils_readbuffer_updated
(
&
contents
,
grafts
->
path
,
if
((
error
=
git_futils_readbuffer_updated
(
&
contents
,
grafts
->
path
,
(
grafts
->
path_checksum
).
id
,
&
updated
);
(
grafts
->
path_checksum
).
id
,
&
updated
))
<
0
)
{
if
(
error
<
0
||
error
==
GIT_ENOTFOUND
||
!
updated
)
{
if
(
error
==
GIT_ENOTFOUND
)
{
if
(
error
==
GIT_ENOTFOUND
)
{
git_grafts_clear
(
grafts
);
git_grafts_clear
(
grafts
);
error
=
0
;
error
=
0
;
}
}
goto
cleanup
;
}
if
(
!
updated
)
{
goto
cleanup
;
goto
cleanup
;
}
}
...
...
src/libgit2/repository.c
View file @
c01b7841
...
@@ -735,13 +735,6 @@ static int load_grafts(git_repository *repo)
...
@@ -735,13 +735,6 @@ static int load_grafts(git_repository *repo)
git_str
path
=
GIT_STR_INIT
;
git_str
path
=
GIT_STR_INIT
;
int
error
;
int
error
;
if
((
error
=
git_repository__item_path
(
&
path
,
repo
,
GIT_REPOSITORY_ITEM_INFO
))
<
0
||
(
error
=
git_str_joinpath
(
&
path
,
path
.
ptr
,
"grafts"
))
<
0
||
(
error
=
git_grafts_from_file
(
&
repo
->
grafts
,
path
.
ptr
))
<
0
)
goto
error
;
git_str_clear
(
&
path
);
if
((
error
=
git_str_joinpath
(
&
path
,
repo
->
gitdir
,
"shallow"
))
<
0
||
if
((
error
=
git_str_joinpath
(
&
path
,
repo
->
gitdir
,
"shallow"
))
<
0
||
(
error
=
git_grafts_from_file
(
&
repo
->
shallow_grafts
,
path
.
ptr
))
<
0
)
(
error
=
git_grafts_from_file
(
&
repo
->
shallow_grafts
,
path
.
ptr
))
<
0
)
goto
error
;
goto
error
;
...
...
src/libgit2/repository.h
View file @
c01b7841
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
#include "submodule.h"
#include "submodule.h"
#include "diff_driver.h"
#include "diff_driver.h"
#include "grafts.h"
#include "grafts.h"
#include "oidarray.h"
#define DOT_GIT ".git"
#define DOT_GIT ".git"
#define GIT_DIR DOT_GIT "/"
#define GIT_DIR DOT_GIT "/"
...
...
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