Commit Diff


commit - a914c6bf9a936469678bf7398b2a02bfc4107d75
commit + 081e3dc235439cbb3e34342349768119ddf4ad49
blob - 408d6c2eca222e770eac22fefded31612c59a877
blob + c03351b201e51e2910ab2d97e0486faf2b0fe56c
--- got/got.c
+++ got/got.c
@@ -4100,7 +4100,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 - 229ab62ccf36a2c9ae3a6b9dd3c953a0c0f7f184
blob + 31f1f3d7c931e5646bc74db0a358823c32e38196
--- tog/tog.c
+++ tog/tog.c
@@ -2346,7 +2346,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);