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
171116e7
Unverified
Commit
171116e7
authored
Jun 14, 2019
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refdb: repurpose filesystem prune function
parent
8fd855fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/refdb_fs.c
+6
-6
No files found.
src/refdb_fs.c
View file @
171116e7
...
...
@@ -1353,10 +1353,10 @@ on_error:
return
error
;
}
static
void
refdb_fs_backend__
try_delete_empty_ref_hierarchie
(
static
void
refdb_fs_backend__
prune_refs
(
refdb_fs_backend
*
backend
,
const
char
*
ref_name
,
bool
reflog
)
const
char
*
prefix
)
{
git_buf
relative_path
=
GIT_BUF_INIT
;
git_buf
base_path
=
GIT_BUF_INIT
;
...
...
@@ -1374,8 +1374,8 @@ static void refdb_fs_backend__try_delete_empty_ref_hierarchie(
git_buf_truncate
(
&
relative_path
,
commonlen
);
if
(
reflog
)
{
if
(
git_buf_join3
(
&
base_path
,
'/'
,
backend
->
commonpath
,
GIT_REFLOG_DIR
,
git_buf_cstr
(
&
relative_path
))
<
0
)
if
(
prefix
)
{
if
(
git_buf_join3
(
&
base_path
,
'/'
,
backend
->
commonpath
,
prefix
,
git_buf_cstr
(
&
relative_path
))
<
0
)
goto
cleanup
;
}
else
{
if
(
git_buf_joinpath
(
&
base_path
,
backend
->
commonpath
,
git_buf_cstr
(
&
relative_path
))
<
0
)
...
...
@@ -1471,7 +1471,7 @@ static int refdb_fs_backend__delete_tail(
cleanup:
git_filebuf_cleanup
(
file
);
if
(
loose_deleted
)
refdb_fs_backend__
try_delete_empty_ref_hierarchie
(
backend
,
ref_name
,
false
);
refdb_fs_backend__
prune_refs
(
backend
,
ref_name
,
""
);
return
error
;
}
...
...
@@ -2101,7 +2101,7 @@ static int refdb_reflog_fs__delete(git_refdb_backend *_backend, const char *name
if
((
error
=
p_unlink
(
path
.
ptr
))
<
0
)
goto
out
;
refdb_fs_backend__
try_delete_empty_ref_hierarchie
(
backend
,
name
,
true
);
refdb_fs_backend__
prune_refs
(
backend
,
name
,
GIT_REFLOG_DIR
);
out
:
git_buf_dispose
(
&
path
);
...
...
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