From: Linus Torvalds Date: Sun, 05 Aug 2007 04:48:08 GMT Subject: Re: possible bug in git apply? Message-ID: In-Reply-To: On Sat, 4 Aug 2007, david@lang.hm wrote: > > since git doesn't track directories, only content (per the big discussion > recently) I beleive that doing a checkout would leave Rob without the > directories that he emptied out, so shouldn't git apply also clear the > directories to end up in the same state? It should. I thought we did that, but maybe there's some bug there. See "remove_file()" in builtin-apply.c. But yeah, it seems that the file *rename* ends up not triggering that logic! Very annoying. Does this fix it? Totally untested, but it _looks_ obvious enough.. Linus --- diff --git a/builtin-apply.c b/builtin-apply.c index 0a0b4a9..da27075 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2508,7 +2508,7 @@ static void write_out_one_result(struct patch *patch, int phase) * thing: remove the old, write the new */ if (phase == 0) - remove_file(patch, 0); + remove_file(patch, patch->is_rename); if (phase == 1) create_file(patch); }