Re: possible bug in git apply?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sat, 4 Aug 2007, david@xxxxxxx 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);
 }
-
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux