summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-05-16 13:21:39 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-07-09 14:36:26 -0700
commitf3b8f91a6919c8ab806016791c4a4bfd63c5169c (patch)
tree66bccc1595995ba2ffe046195e9d21975369d8b0 /builtin
parentapply: fix an incomplete comment in check_patch() (diff)
downloadtgif-f3b8f91a6919c8ab806016791c4a4bfd63c5169c.tar.xz
apply: a bit more comments on PATH_TO_BE_DELETED
The code is littered with to_be_deleted() whose purpose is not so clear. Describe where it matters. Also remove an extra space before "#define" that snuck in by mistake at 7fac0ee (builtin-apply: keep information about files to be deleted, 2009-04-11). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/apply.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index 44f6de903a..35460c940c 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -2970,9 +2970,15 @@ static struct patch *in_fn_table(const char *name)
* item->util in the filename table records the status of the path.
* Usually it points at a patch (whose result records the contents
* of it after applying it), but it could be PATH_WAS_DELETED for a
- * path that a previously applied patch has already removed.
+ * path that a previously applied patch has already removed, or
+ * PATH_TO_BE_DELETED for a path that a later patch would remove.
+ *
+ * The latter is needed to deal with a case where two paths A and B
+ * are swapped by first renaming A to B and then renaming B to A;
+ * moving A to B should not be prevented due to presense of B as we
+ * will remove it in a later patch.
*/
- #define PATH_TO_BE_DELETED ((struct patch *) -2)
+#define PATH_TO_BE_DELETED ((struct patch *) -2)
#define PATH_WAS_DELETED ((struct patch *) -1)
static int to_be_deleted(struct patch *patch)