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
86db1ad5
Commit
86db1ad5
authored
Nov 24, 2020
by
Reginald McLean
Committed by
Edward Thomson
May 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added check if gitdir exists in is_prunable()
Fixes #5598
parent
0fd80681
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
src/libgit2/worktree.c
+9
-0
No files found.
src/libgit2/worktree.c
View file @
86db1ad5
...
...
@@ -565,6 +565,7 @@ int git_worktree_is_prunable(git_worktree *wt,
git_worktree_prune_options
*
opts
)
{
git_worktree_prune_options
popts
=
GIT_WORKTREE_PRUNE_OPTIONS_INIT
;
git_buf
path
=
GIT_BUF_INIT
;
GIT_ERROR_CHECK_VERSION
(
opts
,
GIT_WORKTREE_PRUNE_OPTIONS_VERSION
,
...
...
@@ -595,6 +596,14 @@ int git_worktree_is_prunable(git_worktree *wt,
return
0
;
}
if
(
git_buf_printf
(
&
path
,
"%s/worktrees/%s"
,
wt
->
commondir_path
,
wt
->
name
)
<
0
)
return
0
;
if
(
!
git_path_exists
(
path
.
ptr
))
{
git_error_set
(
GIT_ERROR_WORKTREE
,
"worktree gitdir '%s' does not exist"
,
path
.
ptr
);
return
0
;
}
return
1
;
}
...
...
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