summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2012-12-27 02:32:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-12-28 20:07:47 (GMT)
commitf61988125130ac091bfb69bda5d62b0ad8f054c4 (patch)
tree93e6875927a0a788ed695740b25fc3fadfb0d408 /dir.c
parenta35341a86ecf354d46cf326ed9e0ffbceb54309d (diff)
downloadgit-f61988125130ac091bfb69bda5d62b0ad8f054c4.zip
git-f61988125130ac091bfb69bda5d62b0ad8f054c4.tar.gz
git-f61988125130ac091bfb69bda5d62b0ad8f054c4.tar.bz2
dir.c: rename free_excludes() to clear_exclude_list()
It is clearer to use a 'clear_' prefix for functions which empty and deallocate the contents of a data structure without freeing the structure itself, and a 'free_' prefix for functions which also free the structure itself. http://article.gmane.org/gmane.comp.version-control.git/206128 Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 16e10b0..41f141c 100644
--- a/dir.c
+++ b/dir.c
@@ -400,7 +400,11 @@ static void *read_skip_worktree_file_from_index(const char *path, size_t *size)
return data;
}
-void free_excludes(struct exclude_list *el)
+/*
+ * Frees memory within el which was allocated for exclude patterns and
+ * the file buffer. Does not free el itself.
+ */
+void clear_exclude_list(struct exclude_list *el)
{
int i;