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
5ace1494
Unverified
Commit
5ace1494
authored
Apr 26, 2018
by
Patrick Steinhardt
Committed by
GitHub
Apr 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4633 from csware/worktree-delereref
Fix deletion of unrelated branch on worktree
parents
86353a72
fd7b5bc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletions
+23
-1
src/refdb_fs.c
+1
-1
tests/worktree/refs.c
+22
-0
No files found.
src/refdb_fs.c
View file @
5ace1494
...
...
@@ -1319,7 +1319,7 @@ static int refdb_fs_backend__delete_tail(
}
/* If a loose reference exists, remove it from the filesystem */
if
(
git_buf_joinpath
(
&
loose_path
,
backend
->
git
path
,
ref_name
)
<
0
)
if
(
git_buf_joinpath
(
&
loose_path
,
backend
->
common
path
,
ref_name
)
<
0
)
return
-
1
;
...
...
tests/worktree/refs.c
View file @
5ace1494
...
...
@@ -134,6 +134,28 @@ void test_worktree_refs__delete_succeeds_after_pruning_worktree(void)
git_reference_free
(
branch
);
}
void
test_worktree_refs__delete_unrelated_branch_on_worktree
(
void
)
{
git_reference
*
branch
;
cl_git_pass
(
git_branch_lookup
(
&
branch
,
fixture
.
worktree
,
"merge-conflict"
,
GIT_BRANCH_LOCAL
));
cl_git_pass
(
git_branch_delete
(
branch
));
git_reference_free
(
branch
);
}
void
test_worktree_refs__delete_unrelated_branch_on_parent
(
void
)
{
git_reference
*
branch
;
cl_git_pass
(
git_branch_lookup
(
&
branch
,
fixture
.
repo
,
"merge-conflict"
,
GIT_BRANCH_LOCAL
));
cl_git_pass
(
git_branch_delete
(
branch
));
git_reference_free
(
branch
);
}
void
test_worktree_refs__renaming_reference_updates_worktree_heads
(
void
)
{
git_reference
*
head
,
*
branch
,
*
renamed
;
...
...
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