]> git.ipfire.org Git - thirdparty/git.git/blobdiff - apply.h
Merge branch 'nw/t1002-cleanup'
[thirdparty/git.git] / apply.h
diff --git a/apply.h b/apply.h
index 16202da16026f8ef127e406418229d1f47802b53..b9f18ce87d1e0374a04aaaf785592c752dba6058 100644 (file)
--- a/apply.h
+++ b/apply.h
@@ -4,6 +4,7 @@
 #include "hash.h"
 #include "lockfile.h"
 #include "string-list.h"
+#include "strmap.h"
 
 struct repository;
 
@@ -25,20 +26,6 @@ enum apply_verbosity {
        verbosity_verbose = 1
 };
 
-/*
- * We need to keep track of how symlinks in the preimage are
- * manipulated by the patches.  A patch to add a/b/c where a/b
- * is a symlink should not be allowed to affect the directory
- * the symlink points at, but if the same patch removes a/b,
- * it is perfectly fine, as the patch removes a/b to make room
- * to create a directory a/b so that a/b/c can be created.
- *
- * See also "struct string_list symlink_changes" in "struct
- * apply_state".
- */
-#define APPLY_SYMLINK_GOES_AWAY 01
-#define APPLY_SYMLINK_IN_RESULT 02
-
 struct apply_state {
        const char *prefix;
 
@@ -86,7 +73,16 @@ struct apply_state {
 
        /* Various "current state" */
        int linenr; /* current line number */
-       struct string_list symlink_changes; /* we have to track symlinks */
+       /*
+        * We need to keep track of how symlinks in the preimage are
+        * manipulated by the patches.  A patch to add a/b/c where a/b
+        * is a symlink should not be allowed to affect the directory
+        * the symlink points at, but if the same patch removes a/b,
+        * it is perfectly fine, as the patch removes a/b to make room
+        * to create a directory a/b so that a/b/c can be created.
+        */
+       struct strset removed_symlinks;
+       struct strset kept_symlinks;
 
        /*
         * For "diff-stat" like behaviour, we keep track of the biggest change
@@ -177,6 +173,8 @@ int parse_git_diff_header(struct strbuf *root,
                          unsigned int size,
                          struct patch *patch);
 
+void release_patch(struct patch *patch);
+
 /*
  * Some aspects of the apply behavior are controlled by the following
  * bits in the "options" parameter passed to apply_all_patches().