Skip to content

Commit

Permalink
fileops: rename to "futils.h" to match function signatures
Browse files Browse the repository at this point in the history
Our file utils functions all have a "futils" prefix, e.g.
`git_futils_touch`. One would thus naturally guess that their
definitions and implementation would live in files "futils.h" and
"futils.c", respectively, but in fact they live in "fileops.h".

Rename the files to match expectations.
  • Loading branch information
pks-t committed Jul 20, 2019
1 parent 1f44079 commit e54343a
Show file tree
Hide file tree
Showing 130 changed files with 131 additions and 131 deletions.
2 changes: 1 addition & 1 deletion fuzzers/standalone_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdio.h>

#include "git2.h"
#include "fileops.h"
#include "futils.h"
#include "path.h"

extern int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size);
Expand Down
2 changes: 1 addition & 1 deletion src/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "git2/repository.h"
#include "array.h"
#include "patch.h"
#include "fileops.h"
#include "futils.h"
#include "delta.h"
#include "zstream.h"
#include "reader.h"
Expand Down
2 changes: 1 addition & 1 deletion src/attr_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "vector.h"
#include "pool.h"
#include "buffer.h"
#include "fileops.h"
#include "futils.h"

#define GIT_ATTR_FILE ".gitattributes"
#define GIT_ATTR_FILE_INREPO "attributes"
Expand Down
2 changes: 1 addition & 1 deletion src/blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "git2/blob.h"
#include "repository.h"
#include "odb.h"
#include "fileops.h"
#include "futils.h"

struct git_blob {
git_object object;
Expand Down
2 changes: 1 addition & 1 deletion src/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "git2/tree.h"

#include "remote.h"
#include "fileops.h"
#include "futils.h"
#include "refs.h"
#include "path.h"
#include "repository.h"
Expand Down
2 changes: 1 addition & 1 deletion src/config_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "common.h"

#include "fileops.h"
#include "futils.h"
#include "repository.h"
#include "config.h"
#include "git2/config.h"
Expand Down
2 changes: 1 addition & 1 deletion src/config_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "common.h"

#include "array.h"
#include "fileops.h"
#include "futils.h"
#include "oid.h"
#include "parse.h"

Expand Down
2 changes: 1 addition & 1 deletion src/crlf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "git2/index.h"
#include "git2/sys/filter.h"

#include "fileops.h"
#include "futils.h"
#include "hash.h"
#include "filter.h"
#include "buf_text.h"
Expand Down
2 changes: 1 addition & 1 deletion src/diff_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "diff.h"
#include "diff_generate.h"
#include "odb.h"
#include "fileops.h"
#include "futils.h"
#include "filter.h"

#define DIFF_MAX_FILESIZE 0x20000000
Expand Down
2 changes: 1 addition & 1 deletion src/diff_generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "diff.h"
#include "patch_generate.h"
#include "fileops.h"
#include "futils.h"
#include "config.h"
#include "attr_file.h"
#include "filter.h"
Expand Down
2 changes: 1 addition & 1 deletion src/diff_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "diff.h"
#include "diff_file.h"
#include "patch_generate.h"
#include "fileops.h"
#include "futils.h"
#include "zstream.h"
#include "blob.h"
#include "delta.h"
Expand Down
2 changes: 1 addition & 1 deletion src/diff_tform.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "diff.h"
#include "diff_generate.h"
#include "path.h"
#include "fileops.h"
#include "futils.h"
#include "config.h"

git_diff_delta *git_diff__delta_dup(
Expand Down
2 changes: 1 addition & 1 deletion src/fetchhead.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "git2/oid.h"

#include "buffer.h"
#include "fileops.h"
#include "futils.h"
#include "filebuf.h"
#include "refs.h"
#include "repository.h"
Expand Down
2 changes: 1 addition & 1 deletion src/filebuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "filebuf.h"

#include "fileops.h"
#include "futils.h"

static const size_t WRITE_BUFFER_SIZE = (4096 * 2);

Expand Down
2 changes: 1 addition & 1 deletion src/filebuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "common.h"

#include "fileops.h"
#include "futils.h"
#include "hash.h"
#include <zlib.h>

Expand Down
2 changes: 1 addition & 1 deletion src/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "filter.h"

#include "common.h"
#include "fileops.h"
#include "futils.h"
#include "hash.h"
#include "repository.h"
#include "global.h"
Expand Down
2 changes: 1 addition & 1 deletion src/fileops.c → src/futils.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* a Linking Exception. For full terms see the included COPYING file.
*/

#include "fileops.h"
#include "futils.h"

#include "global.h"
#include "strmap.h"
Expand Down
4 changes: 2 additions & 2 deletions src/fileops.h → src/futils.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_fileops_h__
#define INCLUDE_fileops_h__
#ifndef INCLUDE_futils_h__
#define INCLUDE_futils_h__

#include "common.h"

Expand Down
2 changes: 1 addition & 1 deletion src/hashsig.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "common.h"

#include "git2/sys/hashsig.h"
#include "fileops.h"
#include "futils.h"
#include "util.h"

typedef uint32_t hashsig_t;
Expand Down
2 changes: 1 addition & 1 deletion src/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "common.h"

#include "fileops.h"
#include "futils.h"
#include "filebuf.h"
#include "vector.h"
#include "idxmap.h"
Expand Down
2 changes: 1 addition & 1 deletion src/merge_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "repository.h"
#include "posix.h"
#include "fileops.h"
#include "futils.h"
#include "index.h"
#include "diff_xdiff.h"
#include "merge.h"
Expand Down
2 changes: 1 addition & 1 deletion src/mwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "mwindow.h"

#include "vector.h"
#include "fileops.h"
#include "futils.h"
#include "map.h"
#include "global.h"
#include "strmap.h"
Expand Down
2 changes: 1 addition & 1 deletion src/odb.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <zlib.h>
#include "git2/object.h"
#include "git2/sys/odb_backend.h"
#include "fileops.h"
#include "futils.h"
#include "hash.h"
#include "delta.h"
#include "filter.h"
Expand Down
2 changes: 1 addition & 1 deletion src/odb_loose.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <zlib.h>
#include "git2/object.h"
#include "git2/sys/odb_backend.h"
#include "fileops.h"
#include "futils.h"
#include "hash.h"
#include "odb.h"
#include "delta.h"
Expand Down
2 changes: 1 addition & 1 deletion src/odb_mempack.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "git2/object.h"
#include "git2/sys/odb_backend.h"
#include "git2/sys/mempack.h"
#include "fileops.h"
#include "futils.h"
#include "hash.h"
#include "odb.h"
#include "array.h"
Expand Down
2 changes: 1 addition & 1 deletion src/odb_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "git2/repository.h"
#include "git2/indexer.h"
#include "git2/sys/odb_backend.h"
#include "fileops.h"
#include "futils.h"
#include "hash.h"
#include "odb.h"
#include "delta.h"
Expand Down
2 changes: 1 addition & 1 deletion src/pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "delta.h"
#include "sha1_lookup.h"
#include "mwindow.h"
#include "fileops.h"
#include "futils.h"
#include "oid.h"

#include <zlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/patch_generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "diff_xdiff.h"
#include "delta.h"
#include "zstream.h"
#include "fileops.h"
#include "futils.h"

static void diff_output_init(
git_patch_generated_output *, const git_diff_options *, git_diff_file_cb,
Expand Down
2 changes: 1 addition & 1 deletion src/reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "reader.h"

#include "fileops.h"
#include "futils.h"
#include "blob.h"

#include "git2/tree.h"
Expand Down
2 changes: 1 addition & 1 deletion src/refdb_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "refs.h"
#include "hash.h"
#include "repository.h"
#include "fileops.h"
#include "futils.h"
#include "filebuf.h"
#include "pack.h"
#include "reflog.h"
Expand Down
2 changes: 1 addition & 1 deletion src/refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "hash.h"
#include "repository.h"
#include "fileops.h"
#include "futils.h"
#include "filebuf.h"
#include "pack.h"
#include "reflog.h"
Expand Down
2 changes: 1 addition & 1 deletion src/repository.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "commit.h"
#include "tag.h"
#include "blob.h"
#include "fileops.h"
#include "futils.h"
#include "sysdir.h"
#include "filebuf.h"
#include "index.h"
Expand Down
2 changes: 1 addition & 1 deletion src/sortedcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "common.h"

#include "util.h"
#include "fileops.h"
#include "futils.h"
#include "vector.h"
#include "thread-utils.h"
#include "pool.h"
Expand Down
2 changes: 1 addition & 1 deletion src/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "status.h"

#include "git2.h"
#include "fileops.h"
#include "futils.h"
#include "hash.h"
#include "vector.h"
#include "tree.h"
Expand Down
2 changes: 1 addition & 1 deletion src/submodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "git2/submodule.h"
#include "git2/repository.h"
#include "fileops.h"
#include "futils.h"

/* Notes:
*
Expand Down
2 changes: 1 addition & 1 deletion src/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "commit.h"
#include "git2/repository.h"
#include "git2/object.h"
#include "fileops.h"
#include "futils.h"
#include "tree-cache.h"
#include "index.h"

Expand Down
2 changes: 1 addition & 1 deletion src/win32/posix_w32.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "common.h"

#include "../posix.h"
#include "../fileops.h"
#include "../futils.h"
#include "path.h"
#include "path_w32.h"
#include "utf-conv.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/attr/repo.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "clar_libgit2.h"
#include "fileops.h"
#include "futils.h"
#include "git2/attr.h"
#include "attr.h"
#include "sysdir.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/checkout/binaryunicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "refs.h"
#include "repo/repo_helpers.h"
#include "path.h"
#include "fileops.h"
#include "futils.h"

static git_repository *g_repo;

Expand Down
2 changes: 1 addition & 1 deletion tests/checkout/checkout_helpers.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "clar_libgit2.h"
#include "checkout_helpers.h"
#include "refs.h"
#include "fileops.h"
#include "futils.h"
#include "index.h"

void assert_on_branch(git_repository *repo, const char *branch)
Expand Down
2 changes: 1 addition & 1 deletion tests/checkout/conflict.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "clar_libgit2.h"
#include "git2/repository.h"
#include "git2/sys/index.h"
#include "fileops.h"
#include "futils.h"
#include "repository.h"

static git_repository *g_repo;
Expand Down
2 changes: 1 addition & 1 deletion tests/checkout/crlf.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "clar_libgit2.h"
#include "checkout_helpers.h"
#include "../filter/crlf.h"
#include "fileops.h"
#include "futils.h"

#include "git2/checkout.h"
#include "repository.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/checkout/head.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "refs.h"
#include "repo/repo_helpers.h"
#include "path.h"
#include "fileops.h"
#include "futils.h"

static git_repository *g_repo;

Expand Down
2 changes: 1 addition & 1 deletion tests/checkout/index.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "checkout_helpers.h"

#include "git2/checkout.h"
#include "fileops.h"
#include "futils.h"
#include "repository.h"
#include "remote.h"
#include "repo/repo_helpers.h"
Expand Down
Loading

0 comments on commit e54343a

Please sign in to comment.