summaryrefslogtreecommitdiff
path: root/apply.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-02-05 17:42:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-05 17:42:30 (GMT)
commit4bb003d539acc230fba2519a0430b5d388895131 (patch)
tree7e609eb005aa9c9e668721b19aa6e7fd6742dc63 /apply.h
parentd0bb19cbf7ae9a077f67a97d786482313c3c3f0b (diff)
parent4e9a3252531eab8af5559b25efac02b33f6ca5fe (diff)
downloadgit-4bb003d539acc230fba2519a0430b5d388895131.zip
git-4bb003d539acc230fba2519a0430b5d388895131.tar.gz
git-4bb003d539acc230fba2519a0430b5d388895131.tar.bz2
Merge branch 'rs/apply-symlinks-use-strset'
"git apply" (ab)used the util pointer of the string-list to keep track of how each symbolic link needs to be handled, which has been simplified by using strset. * rs/apply-symlinks-use-strset: apply: use strsets to track symlinks
Diffstat (limited to 'apply.h')
-rw-r--r--apply.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/apply.h b/apply.h
index 16202da..4052da5 100644
--- 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