diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-22T16·46+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-22T16·46+0100 |
commit | 5229c9b232de5bfa959ad6ebbb4c8192ac513352 (patch) | |
tree | 8539e7e23682cac110900f946f034ae44162cacd /third_party/git/refs/files-backend.c | |
parent | f2b211131f2347342dde63975b09cf603149f1a3 (diff) | |
parent | 8518a7a51faaf50f830646d4c3585f51236b9349 (diff) |
merge(3p/git): Merge git upstream at v2.26.2 r/808
Diffstat (limited to 'third_party/git/refs/files-backend.c')
-rw-r--r-- | third_party/git/refs/files-backend.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/third_party/git/refs/files-backend.c b/third_party/git/refs/files-backend.c index d60767ab739f..561c33ac8a97 100644 --- a/third_party/git/refs/files-backend.c +++ b/third_party/git/refs/files-backend.c @@ -465,8 +465,7 @@ stat_ref: close(fd); strbuf_rtrim(&sb_contents); buf = sb_contents.buf; - if (starts_with(buf, "ref:")) { - buf += 4; + if (skip_prefix(buf, "ref:", &buf)) { while (isspace(*buf)) buf++; @@ -1327,7 +1326,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store, { struct files_ref_store *refs = 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; struct ref_lock *lock; struct stat loginfo; @@ -1395,7 +1394,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store, */ if (!copy && !refs_read_ref_full(&refs->base, newrefname, RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE, - &oid, NULL) && + NULL, NULL) && refs_delete_ref(&refs->base, NULL, newrefname, NULL, REF_NO_DEREF)) { if (errno == EISDIR) { |