On Sun, Sep 21, 2008 at 08:58:30AM -0700, Anatol Pomozov wrote: > revision is broken (like we have a junk in the HEAD file) from the > case when "branch is not created yet" (which is part of normal > workflow). > > What about following algorithm. HEAD points to ref and ref is not > created yet. Additional check could be > a) there are no other refs > or/and b) object database is empty I don't think those things have to do with "branch not created yet". They are about "repository has no branches". The only thing that indicates you a branch has not been created is the absence of that ref. So you really have two situations there: 1. a symref like HEAD points to a branch that does not exist 2. the user inputs a ref-name that does not exist In the former, that means we are on a branch that hasn't been created yet (which generally does mean a new repo, but it's possible to reach this state in other ways). Or it means somebody made a mistake when they updated the symref. In the latter, it _could_ mean that we are interested in a branch yet to be born, but in general we consider it to mean the user made a typo. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html