author | Jeff King <peff@peff.net> | |
Thu, 27 Mar 2008 07:30:43 +0000 (03:30 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 27 Mar 2008 20:54:56 +0000 (13:54 -0700) | ||
commit | b717a627629e6886956af54274d507b9711d49e6 | |
tree | 8cf5348654fe216e1af3287984b91dd28f2bab8b | tree | snapshot |
parent | 1768905b51601d5d080168059acd24d13b888a2d | commit | diff |
add--interactive: ignore mode change in 'p'atch command
When a path is examined in the patch subcommand, any mode changes in
the file are given to use in the diff header by git-diff. If no hunks
are staged, then we throw out that header and do not touch the
path. But if _any_ hunks are staged, we use the header, and the mode
is changed together with the contents.
Since the 'p'atch command should just be dealing with hunks that are
shown to the user, it makes sense to just ignore mode changes
entirely. We do squirrel away the mode, though, since the next patch
will allow users to select the mode update separately.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When a path is examined in the patch subcommand, any mode changes in
the file are given to use in the diff header by git-diff. If no hunks
are staged, then we throw out that header and do not touch the
path. But if _any_ hunks are staged, we use the header, and the mode
is changed together with the contents.
Since the 'p'atch command should just be dealing with hunks that are
shown to the user, it makes sense to just ignore mode changes
entirely. We do squirrel away the mode, though, since the next patch
will allow users to select the mode update separately.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-add--interactive.perl | diff | blob | history | |
t/t3701-add-interactive.sh | diff | blob | history |