Re: Possible regression: overwriting untracked files in a fresh repo
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 24, 2009, 22:39 UTC
- Message-ID
- <7viqgc3kgx.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20090824190710.GB25168@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> 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;
}