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
a147408f
Commit
a147408f
authored
Sep 22, 2012
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset: make reset rely on git_repository_head()
parent
b52b6571
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
src/reset.c
+6
-1
No files found.
src/reset.c
View file @
a147408f
...
...
@@ -29,6 +29,7 @@ int git_reset(
git_tree
*
tree
=
NULL
;
int
error
=
-
1
;
git_checkout_opts
opts
;
git_reference
*
head
=
NULL
;
assert
(
repo
&&
target
);
assert
(
reset_type
==
GIT_RESET_SOFT
...
...
@@ -49,7 +50,10 @@ int git_reset(
//TODO: Check for unmerged entries
if
(
git_reference__update
(
repo
,
git_object_id
(
commit
),
GIT_HEAD_FILE
)
<
0
)
if
(
git_repository_head
(
&
head
,
repo
)
<
0
)
goto
cleanup
;
if
(
git_reference_set_oid
(
head
,
git_object_id
(
commit
))
<
0
)
goto
cleanup
;
if
(
reset_type
==
GIT_RESET_SOFT
)
{
...
...
@@ -96,6 +100,7 @@ int git_reset(
error
=
0
;
cleanup:
git_reference_free
(
head
);
git_object_free
(
commit
);
git_index_free
(
index
);
git_tree_free
(
tree
);
...
...
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