git-p4: fix bug in symlink handling
[gitweb.git] / sha1_name.c
index 77299257bf3aa91079d5b883c6676afa6fd2d01c..43884c69b350426b46ed73ffcfd5fc29cf1da1b1 100644 (file)
@@ -280,8 +280,7 @@ int dwim_ref(const char *str, int len, unsigned char *sha1, char **ref)
                                *ref = xstrdup(r);
                        if (!warn_ambiguous_refs)
                                break;
-               } else if ((flag & REF_ISSYMREF) &&
-                          (len != 4 || strcmp(str, "HEAD")))
+               } else if ((flag & REF_ISSYMREF) && strcmp(fullref, "HEAD"))
                        warning("ignoring dangling symref %s.", fullref);
        }
        free(last_branch);