Skip to content

Commit 6b96241

Browse files
committed
refs: don't clear oid before read_raw_ref in the debug ref backend
The debug_read_raw_ref function clears the oid to null_oid before calling read_raw_ref, which causes the oid to be lost even when read_raw_ref successfully reads the reference. This leads to failures when executing commands like "git branch new_branch <commit_id>" with GIT_TRACE_REFS=1, as the command cannot find a valid branch point because the oid is null. Signed-off-by: Xinyu Ruan <r200981113@gmail.com>
1 parent a99f379 commit 6b96241

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

refs/debug.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ static int debug_read_raw_ref(struct ref_store *ref_store, const char *refname,
227227
struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
228228
int res = 0;
229229

230-
oidcpy(oid, null_oid(ref_store->repo->hash_algo));
231230
res = drefs->refs->be->read_raw_ref(drefs->refs, refname, oid, referent,
232231
type, failure_errno);
233232

0 commit comments

Comments
 (0)