Merge branch 'rs/ref-read-cleanup'
Code cleanup. * rs/ref-read-cleanup: remote: pass NULL to read_ref_full() because object ID is not needed refs: pass NULL to refs_read_ref_full() because object ID is not needed
This commit is contained in:
commit
87cbb1ca66
@ -693,9 +693,8 @@ static int mv(int argc, const char **argv)
|
|||||||
for (i = 0; i < remote_branches.nr; i++) {
|
for (i = 0; i < remote_branches.nr; i++) {
|
||||||
struct string_list_item *item = remote_branches.items + i;
|
struct string_list_item *item = remote_branches.items + i;
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
struct object_id oid;
|
|
||||||
|
|
||||||
read_ref_full(item->string, RESOLVE_REF_READING, &oid, &flag);
|
read_ref_full(item->string, RESOLVE_REF_READING, NULL, &flag);
|
||||||
if (!(flag & REF_ISSYMREF))
|
if (!(flag & REF_ISSYMREF))
|
||||||
continue;
|
continue;
|
||||||
if (delete_ref(NULL, item->string, NULL, REF_NO_DEREF))
|
if (delete_ref(NULL, item->string, NULL, REF_NO_DEREF))
|
||||||
|
@ -1327,7 +1327,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
|
|||||||
{
|
{
|
||||||
struct files_ref_store *refs =
|
struct files_ref_store *refs =
|
||||||
files_downcast(ref_store, REF_STORE_WRITE, "rename_ref");
|
files_downcast(ref_store, REF_STORE_WRITE, "rename_ref");
|
||||||
struct object_id oid, orig_oid;
|
struct object_id orig_oid;
|
||||||
int flag = 0, logmoved = 0;
|
int flag = 0, logmoved = 0;
|
||||||
struct ref_lock *lock;
|
struct ref_lock *lock;
|
||||||
struct stat loginfo;
|
struct stat loginfo;
|
||||||
@ -1395,7 +1395,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
|
|||||||
*/
|
*/
|
||||||
if (!copy && !refs_read_ref_full(&refs->base, newrefname,
|
if (!copy && !refs_read_ref_full(&refs->base, newrefname,
|
||||||
RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
|
RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
|
||||||
&oid, NULL) &&
|
NULL, NULL) &&
|
||||||
refs_delete_ref(&refs->base, NULL, newrefname,
|
refs_delete_ref(&refs->base, NULL, newrefname,
|
||||||
NULL, REF_NO_DEREF)) {
|
NULL, REF_NO_DEREF)) {
|
||||||
if (errno == EISDIR) {
|
if (errno == EISDIR) {
|
||||||
|
Loading…
Reference in New Issue
Block a user