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
3548fcf5
Commit
3548fcf5
authored
Oct 11, 2012
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs: propagate EEXISTS upon renaming
parent
a75770fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
src/refs.c
+2
-2
tests-clar/refs/rename.c
+11
-0
No files found.
src/refs.c
View file @
3548fcf5
...
@@ -1357,8 +1357,8 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
...
@@ -1357,8 +1357,8 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
normalization_flags
)
<
0
)
normalization_flags
)
<
0
)
return
-
1
;
return
-
1
;
if
(
reference_can_write
(
ref
->
owner
,
normalized
,
ref
->
name
,
force
)
<
0
)
if
(
(
result
=
reference_can_write
(
ref
->
owner
,
normalized
,
ref
->
name
,
force
)
)
<
0
)
return
-
1
;
return
result
;
/* Initialize path now so we won't get an allocation failure once
/* Initialize path now so we won't get an allocation failure once
* we actually start removing things. */
* we actually start removing things. */
...
...
tests-clar/refs/rename.c
View file @
3548fcf5
...
@@ -337,3 +337,14 @@ void test_refs_rename__move_up(void)
...
@@ -337,3 +337,14 @@ void test_refs_rename__move_up(void)
git_reference_free
(
ref
);
git_reference_free
(
ref
);
git_reference_free
(
looked_up_ref
);
git_reference_free
(
looked_up_ref
);
}
}
void
test_refs_rename__propagate_eexists
(
void
)
{
git_reference
*
ref
;
cl_git_pass
(
git_reference_lookup
(
&
ref
,
g_repo
,
packed_head_name
));
cl_assert_equal_i
(
GIT_EEXISTS
,
git_reference_rename
(
ref
,
packed_test_head_name
,
0
));
git_reference_free
(
ref
);
}
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