Thread (126 messages) 126 messages, 9 authors, 2024-12-05

Re: [PATCH v14 03/10] refs: standardize output of refs_read_symbolic_ref

From: Bence Ferdinandy <hidden>
Date: 2024-11-22 11:28:04

Possibly related (same subject, not in this thread)

On Fri Nov 22, 2024 at 11:37, karthik nayak [off-list ref] wrote:
Bence Ferdinandy [off-list ref] writes:

[snip]
quoted
diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
index 38eb14d591..1809e3426a 100644
--- a/refs/reftable-backend.c
+++ b/refs/reftable-backend.c
@@ -830,10 +830,12 @@ static int reftable_be_read_symbolic_ref(struct ref_store *ref_store,
 		return ret;

 	ret = reftable_stack_read_ref(stack, refname, &ref);
-	if (ret == 0 && ref.value_type == REFTABLE_REF_SYMREF)
+        if (ret)
+                ret = -1;
+        else if (ref.value_type == REFTABLE_REF_SYMREF)
 		strbuf_addstr(referent, ref.value.symref);
-	else
-		ret = -1;
+        else
+                ret = NOT_A_SYMREF;
I was building my series on top of this, and noticed whitespace issues
here. A simple way to check your series is to run:
Found it, thanks for catching, I had tabs and whitespaces mixed. 

git log --check didn't find a problem with that though. 
quoted
 	reftable_ref_record_release(&ref);
 	return ret;
--
2.47.0.298.g52a96ec17b



-- 
bence.ferdinandy.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help