X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=add-patch.c;h=be4cf6e9e5d733e477737be5d5a77fe3ccf48e24;hb=f3cfeb3078ce4af0ac764515795f7e0849a88931;hp=bd94bd3a7c9e86f4af6d9b887c824ff5be2db9a5;hpb=380ba9907737fea75c9e6bbce9df04c556fbf882;p=thirdparty%2Fgit.git diff --git a/add-patch.c b/add-patch.c index bd94bd3a7c..be4cf6e9e5 100644 --- a/add-patch.c +++ b/add-patch.c @@ -1695,6 +1695,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