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
26515e73
Commit
26515e73
authored
Apr 23, 2012
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename to git_reference_name_to_oid
parent
44ef8b1b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
6 deletions
+7
-6
include/git2/refs.h
+2
-1
src/refs.c
+1
-1
src/revwalk.c
+1
-1
src/status.c
+1
-1
src/transports/local.c
+1
-1
tests-clar/refs/lookup.c
+1
-1
No files found.
include/git2/refs.h
View file @
26515e73
...
...
@@ -40,7 +40,8 @@ GIT_EXTERN(int) git_reference_lookup(git_reference **reference_out, git_reposito
* @param name The long name for the reference
* @return 0 on success, -1 if name could not be resolved
*/
GIT_EXTERN
(
int
)
git_reference_lookup_oid
(
git_oid
*
out
,
git_repository
*
repo
,
const
char
*
name
);
GIT_EXTERN
(
int
)
git_reference_name_to_oid
(
git_oid
*
out
,
git_repository
*
repo
,
const
char
*
name
);
/**
* Create a new symbolic reference.
...
...
src/refs.c
View file @
26515e73
...
...
@@ -1061,7 +1061,7 @@ int git_reference_lookup(git_reference **ref_out,
return
git_reference_lookup_resolved
(
ref_out
,
repo
,
name
,
0
);
}
int
git_reference_
lookup
_oid
(
int
git_reference_
name_to
_oid
(
git_oid
*
out
,
git_repository
*
repo
,
const
char
*
name
)
{
int
error
;
...
...
src/revwalk.c
View file @
26515e73
...
...
@@ -494,7 +494,7 @@ static int push_ref(git_revwalk *walk, const char *refname, int hide)
{
git_oid
oid
;
if
(
git_reference_
lookup
_oid
(
&
oid
,
walk
->
repo
,
refname
)
<
0
)
if
(
git_reference_
name_to
_oid
(
&
oid
,
walk
->
repo
,
refname
)
<
0
)
return
-
1
;
return
push_commit
(
walk
,
&
oid
,
hide
);
...
...
src/status.c
View file @
26515e73
...
...
@@ -23,7 +23,7 @@ static int resolve_head_to_tree(git_tree **tree, git_repository *repo)
git_oid
head_oid
;
git_object
*
obj
=
NULL
;
if
(
git_reference_
lookup
_oid
(
&
head_oid
,
repo
,
GIT_HEAD_FILE
)
<
0
)
{
if
(
git_reference_
name_to
_oid
(
&
head_oid
,
repo
,
GIT_HEAD_FILE
)
<
0
)
{
/* cannot resolve HEAD - probably brand new repo */
giterr_clear
();
*
tree
=
NULL
;
...
...
src/transports/local.c
View file @
26515e73
...
...
@@ -35,7 +35,7 @@ static int add_ref(transport_local *t, const char *name)
head
->
name
=
git__strdup
(
name
);
GITERR_CHECK_ALLOC
(
head
->
name
);
if
(
git_reference_
lookup
_oid
(
&
head
->
oid
,
t
->
repo
,
name
)
<
0
||
if
(
git_reference_
name_to
_oid
(
&
head
->
oid
,
t
->
repo
,
name
)
<
0
||
git_vector_insert
(
&
t
->
refs
,
head
)
<
0
)
{
git__free
(
head
->
name
);
...
...
tests-clar/refs/lookup.c
View file @
26515e73
...
...
@@ -36,7 +36,7 @@ void test_refs_lookup__oid(void)
{
git_oid
tag
,
expected
;
cl_git_pass
(
git_reference_
lookup
_oid
(
&
tag
,
g_repo
,
"refs/tags/point_to_blob"
));
cl_git_pass
(
git_reference_
name_to
_oid
(
&
tag
,
g_repo
,
"refs/tags/point_to_blob"
));
cl_git_pass
(
git_oid_fromstr
(
&
expected
,
"1385f264afb75a56a5bec74243be9b367ba4ca08"
));
cl_assert
(
git_oid_cmp
(
&
tag
,
&
expected
)
==
0
);
}
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