status: Remove status_old This is Git yo. You can fetch stuff from the history if you need it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
diff --git a/src/status.c b/src/status.c
index 7cd914f..95e4588 100644
--- a/src/status.c
+++ b/src/status.c
@@ -654,88 +654,6 @@ static int dirent_cb(void *state, git_buf *a)
}
}
-static int status_cmp(const void *a, const void *b)
-{
- const struct status_entry *entry_a = (const struct status_entry *)(a);
- const struct status_entry *entry_b = (const struct status_entry *)(b);
-
- return strcmp(entry_a->path, entry_b->path);
-}
-
-#define DEFAULT_SIZE 16
-
-int git_status_foreach_old(
- git_repository *repo,
- int (*callback)(const char *, unsigned int, void *),
- void *payload)
-{
- git_vector entries;
- git_ignores ignores;
- git_index *index = NULL;
- git_buf temp_path = GIT_BUF_INIT;
- struct status_st dirent_st = {0};
- int error = 0;
- unsigned int i;
- git_tree *tree;
- struct status_entry *e;
- const char *workdir;
-
- assert(repo);
-
- if ((workdir = git_repository_workdir(repo)) == NULL ||
- !git_path_isdir(workdir))
- {
- giterr_set(GITERR_OS, "Cannot get status - invalid working directory");
- return GIT_ENOTFOUND;
- }
-
- if ((error = git_repository_index__weakptr(&index, repo)) < 0 ||
- (error = retrieve_head_tree(&tree, repo)) < 0)
- return error;
-
- if ((error = git_vector_init(&entries, DEFAULT_SIZE, status_cmp)) < 0)
- goto exit;
-
- dirent_st.repo = repo;
- dirent_st.vector = &entries;
- dirent_st.index = index;
- dirent_st.tree = tree;
- dirent_st.ignores = &ignores;
- dirent_st.workdir_path_len = strlen(workdir);
- git_buf_init(&dirent_st.head_tree_relative_path, 0);
- dirent_st.head_tree_relative_path_len = 0;
- dirent_st.tree_position = 0;
- dirent_st.index_position = 0;
- dirent_st.is_dir = 1;
-
- git_buf_sets(&temp_path, workdir);
-
- if ((error = git_ignore__for_path(repo, "", dirent_st.ignores)) < 0)
- goto exit;
-
- error = alphasorted_futils_direach(&temp_path, dirent_cb, &dirent_st);
-
- if (!error)
- error = dirent_cb(&dirent_st, NULL);
-
- for (i = 0; i < entries.length; ++i) {
- e = (struct status_entry *)git_vector_get(&entries, i);
-
- if (!error)
- error = callback(e->path, e->status_flags, payload);
-
- git__free(e);
- }
-
-exit:
- git_buf_free(&dirent_st.head_tree_relative_path);
- git_buf_free(&temp_path);
- git_vector_free(&entries);
- git_ignore__free(&ignores);
- git_tree_free(tree);
- return error;
-}
-
static int recurse_tree_entry(git_tree *tree, struct status_entry *e, const char *path)
{
char *dir_sep;