1. 21 2月, 2007 2 次提交
  2. 20 2月, 2007 3 次提交
    • J
      eac70c4f
    • J
      git-apply: require -p<n> when working in a subdirectory. · 56185f49
      Junio C Hamano 提交于
      git-apply running inside a subdirectory, with or without --index,
      used to always assume that the patch is formatted in such a way
      to apply with -p1 from the toplevel, but it is more useful and
      consistent with the use of "GNU patch -p1" if it defaulted to
      assume that its input is meant to apply at the level it is
      invoked in.
      
      This changes the behaviour.  It used to be that the patch
      generated this way would apply without any trick:
      
      	edit Documentation/Makefile
      	git diff >patch.file
      	cd Documentation
      	git apply ../patch.file
      
      You need to give an explicit -p2 to git-apply now.  On the other
      hand, if you got a patch from somebody else who did not follow
      "patch is to apply from the top with -p1" convention, the input
      patch would start with:
      
      	diff -u Makefile.old Makefile
      	--- Makefile.old
      	+++ Makefile
      
      and in such a case, you can apply it with:
      
      	git apply -p0 patch.file
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      56185f49
    • J
      git-apply: do not lose cwd when run from a subdirectory. · aea19457
      Junio C Hamano 提交于
      When a patch modifies (not deletes) the last file in a
      directory, because we treat a modification just as deletion
      followed by creation, and deleting the last file in a directory
      automatically rmdir(2)'s that directory, we ended up removing
      the directory, which can potentially be the cwd, and then
      recreating the same directory to create the patch result.
      
      Avoid the rmdir step when remove_file() is called only because
      we are replacing it with the result by later calling
      create_file().
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      aea19457
  3. 18 2月, 2007 2 次提交
  4. 14 2月, 2007 8 次提交
  5. 13 2月, 2007 20 次提交
  6. 12 2月, 2007 5 次提交