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
62993b61
Commit
62993b61
authored
Oct 11, 2012
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches: propagate EEXISTS upon creation
parent
3548fcf5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
src/branch.c
+4
-5
tests-clar/refs/branches/create.c
+1
-1
No files found.
src/branch.c
View file @
62993b61
...
...
@@ -77,12 +77,11 @@ int git_branch_create(
if
(
git_buf_joinpath
(
&
canonical_branch_name
,
GIT_REFS_HEADS_DIR
,
branch_name
)
<
0
)
goto
cleanup
;
if
(
git_reference_create_oid
(
&
branch
,
repository
,
git_buf_cstr
(
&
canonical_branch_name
),
git_object_id
(
commit
),
force
)
<
0
)
goto
cleanup
;
error
=
git_reference_create_oid
(
&
branch
,
repository
,
git_buf_cstr
(
&
canonical_branch_name
),
git_object_id
(
commit
),
force
);
*
ref_out
=
branch
;
error
=
0
;
if
(
!
error
)
*
ref_out
=
branch
;
cleanup:
git_object_free
(
commit
);
...
...
tests-clar/refs/branches/create.c
View file @
62993b61
...
...
@@ -50,7 +50,7 @@ void test_refs_branches_create__can_not_create_a_branch_if_its_name_collide_with
{
retrieve_known_commit
(
&
target
,
repo
);
cl_
git_fail
(
git_branch_create
(
&
branch
,
repo
,
"br2"
,
target
,
0
));
cl_
assert_equal_i
(
GIT_EEXISTS
,
git_branch_create
(
&
branch
,
repo
,
"br2"
,
target
,
0
));
}
void
test_refs_branches_create__can_force_create_over_an_existing_branch
(
void
)
...
...
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