Thread (234 messages) flat view 234 messages, 5 authors, 2017-04-07

Re: [PATCH 06/11] refs-internal.h: correct is_per_worktree_ref()

From: Stefan Beller <hidden>
Date: 2017-02-14 17:41:03

On Tue, Feb 14, 2017 at 1:40 AM, Duy Nguyen [off-list ref] wrote:
On Tue, Feb 14, 2017 at 5:37 AM, Stefan Beller [off-list ref] wrote:
quoted
On Mon, Feb 13, 2017 at 7:20 AM, Nguyễn Thái Ngọc Duy [off-list ref] wrote:
quoted
All refs outside refs/ directory is per-worktree, not just HEAD.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 refs/refs-internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index f4aed49f5..69d02b6ba 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -653,7 +653,7 @@ const char *resolve_ref_recursively(struct ref_store *refs,

 static inline int is_per_worktree_ref(const char *refname)
 {
-       return !strcmp(refname, "HEAD") ||
+       return !starts_with(refname, "refs/") ||
                starts_with(refname, "refs/bisect/");
you're loosing HEAD here? (assuming we get HEAD in
short form here, as well as long form refs/HEAD)
I don't understand. if refname is HEAD then both !strcmp(...) and
!starts_with(refname, "refs/") return 1. If it's refs/HEAD, both
return 0. In other words, there's no functional changes?
eh, my bad. You're right.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help