Skip to content

Commit

Permalink
Squelch overzealous "ignoring dangling symref" in an empty repository
Browse files Browse the repository at this point in the history
057e713 (Warn use of "origin" when remotes/origin/HEAD is dangling,
2009-02-08) tried to warn dangling refs/remotes/origin/HEAD only when
"origin" was used to refer to it.  There was one corner case a symref is
expected to be dangling and this warning is unwarranted: HEAD in an empty
repository.

This squelches the warning for this special case.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 11, 2009
1 parent aff4e8d commit 9e5b80c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sha1_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ 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)
} else if ((flag & REF_ISSYMREF) &&
(len != 4 || strcmp(str, "HEAD")))
warning("ignoring dangling symref %s.", fullref);
}
free(last_branch);
Expand Down

0 comments on commit 9e5b80c

Please sign in to comment.