Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Possible regression: overwriting untracked files in a fresh repo

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:18

Jeff King [off-list ref] 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;
	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help