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
e2d42622
Commit
e2d42622
authored
Mar 03, 2011
by
nulltoken
Committed by
Vicent Marti
Mar 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reference renaming to prevent duplicated names
parent
de05ff6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
src/refs.c
+10
-0
No files found.
src/refs.c
View file @
e2d42622
...
...
@@ -1124,9 +1124,19 @@ int git_reference_rename(git_reference *ref, const char *new_name)
int
error
;
char
*
old_name
;
char
old_path
[
GIT_PATH_MAX
],
new_path
[
GIT_PATH_MAX
];
git_reference
*
looked_up_ref
;
assert
(
ref
);
/* Ensure we're not going to overwrite an existing reference */
error
=
git_repository_lookup_ref
(
&
looked_up_ref
,
ref
->
owner
,
new_name
);
if
(
error
==
GIT_SUCCESS
)
return
GIT_EINVALIDREFNAME
;
if
(
error
!=
GIT_ENOTFOUND
)
return
error
;
old_name
=
ref
->
name
;
ref
->
name
=
git__strdup
(
new_name
);
...
...
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