From: Junio C Hamano Date: Mon, 24 Aug 2009 22:39:26 GMT Subject: Re: Possible regression: overwriting untracked files in a fresh repo Message-ID: <7viqgc3kgx.fsf@alter.siamese.dyndns.org> In-Reply-To: <20090824190710.GB25168@coredump.intra.peff.net> Jeff King writes: > However, if I then do this: > > (cd parent && echo content >another && git add . && git commit -m more) > (cd child && git fetch ../parent && git checkout -b new FETCH_HEAD) > > then it does complain. I'm guessing there is a different code path for > the case that we have no index at all, and that it is not properly > checking for overwrites. I think it is this "opts->force = 1" done when you are on an unborn branch. if (!old.commit && !opts->force) { if (!opts->quiet) { warning("You appear to be on a branch yet to be born."); warning("Forcing checkout of %s.", new->name); } opts->force = 1; }