summaryrefslogtreecommitdiff
path: root/entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'entry.c')
-rw-r--r--entry.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/entry.c b/entry.c
index 29df651f87..3143b9996b 100644
--- a/entry.c
+++ b/entry.c
@@ -1,5 +1,6 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
-#include "blob.h"
#include "object-store-ll.h"
#include "dir.h"
#include "environment.h"
@@ -168,6 +169,11 @@ static int remove_available_paths(struct string_list_item *item, void *cb_data)
return !available;
}
+static int string_is_not_null(struct string_list_item *item, void *data UNUSED)
+{
+ return !!item->string;
+}
+
int finish_delayed_checkout(struct checkout *state, int show_progress)
{
int errs = 0;
@@ -185,12 +191,12 @@ int finish_delayed_checkout(struct checkout *state, int show_progress)
progress = start_delayed_progress(_("Filtering content"), dco->paths.nr);
while (dco->filters.nr > 0) {
for_each_string_list_item(filter, &dco->filters) {
- struct string_list available_paths = STRING_LIST_INIT_NODUP;
+ struct string_list available_paths = STRING_LIST_INIT_DUP;
if (!async_query_available_blobs(filter->string, &available_paths)) {
/* Filter reported an error */
errs = 1;
- filter->string = "";
+ filter->string = NULL;
continue;
}
if (available_paths.nr <= 0) {
@@ -200,7 +206,7 @@ int finish_delayed_checkout(struct checkout *state, int show_progress)
* filter from the list (see
* "string_list_remove_empty_items" call below).
*/
- filter->string = "";
+ filter->string = NULL;
continue;
}
@@ -226,7 +232,7 @@ int finish_delayed_checkout(struct checkout *state, int show_progress)
* Do not ask the filter for available blobs,
* again, as the filter is likely buggy.
*/
- filter->string = "";
+ filter->string = NULL;
continue;
}
ce = index_file_exists(state->istate, path->string,
@@ -239,8 +245,11 @@ int finish_delayed_checkout(struct checkout *state, int show_progress)
} else
errs = 1;
}
+
+ string_list_clear(&available_paths, 0);
}
- string_list_remove_empty_items(&dco->filters, 0);
+
+ filter_string_list(&dco->filters, 0, string_is_not_null, NULL);
}
stop_progress(&progress);
string_list_clear(&dco->filters, 0);
@@ -595,3 +604,8 @@ void unlink_entry(const struct cache_entry *ce, const char *super_prefix)
return;
schedule_dir_for_removal(ce->name, ce_namelen(ce));
}
+
+int remove_or_warn(unsigned int mode, const char *file)
+{
+ return S_ISGITLINK(mode) ? rmdir_or_warn(file) : unlink_or_warn(file);
+}