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
8a155a04
Commit
8a155a04
authored
Jul 27, 2012
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mismatched git_branch_create args.
parent
7affe23d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/clone.c
+4
-3
No files found.
src/clone.c
View file @
8a155a04
...
...
@@ -37,7 +37,7 @@ struct HeadInfo {
static
int
create_tracking_branch
(
git_repository
*
repo
,
const
git_oid
*
target
,
const
char
*
name
)
{
git_object
*
head_obj
=
NULL
;
git_
oid
branch_oid
;
git_
reference
*
branch_ref
;
int
retcode
=
GIT_ERROR
;
/* Find the target commit */
...
...
@@ -45,7 +45,8 @@ static int create_tracking_branch(git_repository *repo, const git_oid *target, c
return
GIT_ERROR
;
/* Create the new branch */
if
(
!
git_branch_create
(
&
branch_oid
,
repo
,
name
,
head_obj
,
0
))
{
if
(
!
git_branch_create
(
&
branch_ref
,
repo
,
name
,
head_obj
,
0
))
{
git_reference_free
(
branch_ref
);
/* Set up tracking */
git_config
*
cfg
;
if
(
!
git_repository_config
(
&
cfg
,
repo
))
{
...
...
@@ -94,7 +95,7 @@ static int update_head_to_new_branch(git_repository *repo, const git_oid *target
git_reference
*
head
;
if
(
!
git_reference_lookup
(
&
head
,
repo
,
GIT_HEAD_FILE
))
{
git_buf
targetbuf
=
GIT_BUF_INIT
;
if
(
!
git_buf_printf
(
&
targetbuf
,
"refs/heads/%s"
,
name
)
&&
if
(
!
git_buf_printf
(
&
targetbuf
,
"refs/heads/%s"
,
name
)
&&
/* TODO: "refs/heads" constant? */
!
git_reference_set_target
(
head
,
git_buf_cstr
(
&
targetbuf
)))
{
/* Read the tree into the index */
git_commit
*
commit
;
...
...
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