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
33c33707
Commit
33c33707
authored
Jul 04, 2012
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs: deploy git_reference_has_log()
parent
75261421
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
include/git2/reflog.h
+2
-0
src/refs.c
+2
-8
No files found.
include/git2/reflog.h
View file @
33c33707
...
@@ -53,6 +53,8 @@ GIT_EXTERN(int) git_reflog_write(git_reference *ref, const git_oid *oid_old, con
...
@@ -53,6 +53,8 @@ GIT_EXTERN(int) git_reflog_write(git_reference *ref, const git_oid *oid_old, con
/**
/**
* Rename the reflog for the given reference
* Rename the reflog for the given reference
*
*
* The reflog to be renamed is expected to already exist
*
* @param ref the reference
* @param ref the reference
* @param new_name the new name of the reference
* @param new_name the new name of the reference
* @return 0 or an error code
* @return 0 or an error code
...
...
src/refs.c
View file @
33c33707
...
@@ -1404,18 +1404,12 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
...
@@ -1404,18 +1404,12 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
}
}
/*
/*
* Rename the reflog file.
* Rename the reflog file
, if it exists
.
*/
*/
git_buf_clear
(
&
aux_path
);
if
((
git_reference_has_log
(
ref
))
&&
(
git_reflog_rename
(
ref
,
new_name
)
<
0
))
if
(
git_buf_join_n
(
&
aux_path
,
'/'
,
3
,
ref
->
owner
->
path_repository
,
GIT_REFLOG_DIR
,
ref
->
name
)
<
0
)
goto
cleanup
;
goto
cleanup
;
if
(
git_path_exists
(
aux_path
.
ptr
)
==
true
)
{
if
(
git_reflog_rename
(
ref
,
new_name
)
<
0
)
goto
cleanup
;
}
else
{
giterr_clear
();
giterr_clear
();
}
/*
/*
* Change the name of the reference given by the user.
* Change the name of the reference given by the user.
...
...
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