summaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2020-10-07 07:56:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-10-07 16:49:06 (GMT)
commitf82a9e517fc063bb97063e4df2cdde2fd1f7ffbe (patch)
tree6d7a91a7ab99734a898ff6789cc0705c58bb47f8 /git-add--interactive.perl
parentc693ef781bef002bca15be74bec3a6a65c679eb5 (diff)
downloadgit-f82a9e517fc063bb97063e4df2cdde2fd1f7ffbe.zip
git-f82a9e517fc063bb97063e4df2cdde2fd1f7ffbe.tar.gz
git-f82a9e517fc063bb97063e4df2cdde2fd1f7ffbe.tar.bz2
add-patch: add NEEDSWORK about comparing commits
The two versions of add-patch has special-casing for the literal revision "HEAD". However, we want to handle other ways of saying "HEAD" in the same way.[0] Add a NEEDSWORK to the add-patch code that does this so that it can be addressed later. [0]: https://lore.kernel.org/git/xmqqsgat7ttf.fsf@gitster.c.googlers.com/ Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-xgit-add--interactive.perl7
1 files changed, 7 insertions, 0 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index f36c007..d5ef7fc 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1807,6 +1807,13 @@ sub process_args {
$arg = shift @ARGV or die __("missing --");
if ($arg ne '--') {
$patch_mode_revision = $arg;
+
+ # NEEDSWORK: Instead of comparing to the literal "HEAD",
+ # compare the commit objects instead so that other ways of
+ # saying the same thing (such as "@") are also handled
+ # appropriately.
+ #
+ # This applies to the cases below too.
$patch_mode = ($arg eq 'HEAD' ?
'reset_head' : 'reset_nothead');
$arg = shift @ARGV or die __("missing --");