It appears that get_oid_with_context calls into get_short_oid for that case, and get_short_oid returns SHORT_NAME_AMBIGUOUS, which is -2. We treat that as DANGLING_SYMLINK, which also seems to have the value -2. So, it's an ambiguity in ambiguity resolution. Fix attached. On Fri, 2019-01-18 at 03:38 +0000, Eric Wong wrote: > Hi David, > > Perhaps I'm confused, the cat-file manpage seems to indicate > "dangling" only gets printed if I use "--follow-symlinks". > > However, I'm not using "--follow-symlinks" and I get > "dangling" when passing ambiguous object IDs: > > Trying to check the ambiguous "dead" against git.git, I get: > > $ echo dead | git cat-file --batch-check 2>/dev/null > dangling 4 > dead > > Is the above intended? > > stderr shows the ambiguity and gives me hints, which is expected. > > Thanks. >