commit 563ffc1b6d823b71bab79a0a75c67524f3d0f447 from: Omar Polo date: Wed Jun 14 08:33:35 2023 UTC got, tog: correctly skip HEAD in build_refs_str() s[strlen(s)] == '\0' is banally always true, the intent was to not skip refs that starts with "HEAD". style nit / ok stsp@ commit - c6119c6d1145977d2ae8fb6754a9c369731d8dec commit + 563ffc1b6d823b71bab79a0a75c67524f3d0f447 blob - 9f5251a990cf46f44d7ad7659d1b24da2364c587 blob + 94bf306447c1f76eadeb7357e88c4c7b6fce7790 --- got/got.c +++ got/got.c @@ -4101,7 +4101,7 @@ build_refs_str(char **refs_str, struct got_reflist_hea continue; name += 8; s = strstr(name, "/" GOT_REF_HEAD); - if (s != NULL && s[strlen(s)] == '\0') + if (s != NULL && strcmp(s, "/" GOT_REF_HEAD) == 0) continue; } err = got_ref_resolve(&ref_id, repo, re->ref); blob - 4afeb87f0f5086b887285255029b2bfc2ed97b5e blob + d694a6164057730509b8e3db4e24c4ae1ef16c64 --- tog/tog.c +++ tog/tog.c @@ -2342,7 +2342,7 @@ build_refs_str(char **refs_str, struct got_reflist_hea if (strncmp(name, "remotes/", 8) == 0) { name += 8; s = strstr(name, "/" GOT_REF_HEAD); - if (s != NULL && s[strlen(s)] == '\0') + if (s != NULL && strcmp(s, "/" GOT_REF_HEAD) == 0) continue; } err = got_ref_resolve(&ref_id, repo, re->ref);