mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-06 17:13:55 +00:00
refs: Remove bogus assertion
The assertion in line 360 was there to check that only loose refs were being written as loose, but there are times when we need to re-write a packed reference as loose.
This commit is contained in:
parent
e0fc39da9a
commit
637edc9c42
@ -357,8 +357,6 @@ static int loose_write(git_reference *ref)
|
||||
int error;
|
||||
struct stat st;
|
||||
|
||||
assert((ref->type & GIT_REF_PACKED) == 0);
|
||||
|
||||
git__joinpath(ref_path, ref->owner->path_repository, ref->name);
|
||||
|
||||
if ((error = git_filebuf_open(&file, ref_path, GIT_FILEBUF_FORCE)) < GIT_SUCCESS)
|
||||
@ -1348,8 +1346,6 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
|
||||
* us to rollback if writing fails
|
||||
*/
|
||||
|
||||
ref->type &= ~GIT_REF_PACKED;
|
||||
|
||||
/* Create the loose ref under its new name */
|
||||
error = loose_write(ref);
|
||||
if (error < GIT_SUCCESS) {
|
||||
@ -1357,6 +1353,8 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ref->type &= ~GIT_REF_PACKED;
|
||||
|
||||
/* Remove from the packfile cache in order to avoid packing it back
|
||||
* Note : we do not rely on git_reference_delete() because this would
|
||||
* invalidate the reference.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user