Commit Diff


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);