diff options
author | Denton Liu <liu.denton@gmail.com> | 2020-10-07 00:56:17 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-10-07 09:49:06 -0700 |
commit | f82a9e517fc063bb97063e4df2cdde2fd1f7ffbe (patch) | |
tree | 6d7a91a7ab99734a898ff6789cc0705c58bb47f8 /add-patch.c | |
parent | Doc: document "A...B" form for <tree-ish> in checkout and switch (diff) | |
download | tgif-f82a9e517fc063bb97063e4df2cdde2fd1f7ffbe.tar.xz |
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 'add-patch.c')
-rw-r--r-- | add-patch.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/add-patch.c b/add-patch.c index f899389e2c..64ab7faa96 100644 --- a/add-patch.c +++ b/add-patch.c @@ -1646,6 +1646,14 @@ int run_add_p(struct repository *r, enum add_p_mode mode, if (mode == ADD_P_STASH) s.mode = &patch_mode_stash; else if (mode == ADD_P_RESET) { + /* + * 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. + */ if (!revision || !strcmp(revision, "HEAD")) s.mode = &patch_mode_reset_head; else |