Commit fc42c28e by Edward Thomson

util: don't include unnecessary system libraries

Remove some unnecessary includes from utility code.
parent ea62f546
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#endif #endif
#include "util.h" #include "util.h"
#include "cache.h"
#include "posix.h" #include "posix.h"
#include "date.h" #include "date.h"
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include "vector.h" #include "vector.h"
#include "utf8.h" #include "utf8.h"
#include "git2/sys/path.h"
/** /**
* Path manipulation utils * Path manipulation utils
* *
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include "win32/findfile.h" #include "win32/findfile.h"
#endif #endif
#define GIT_FILEMODE_DEFAULT 0100666
int git_futils_mkpath2file(const char *file_path, const mode_t mode) int git_futils_mkpath2file(const char *file_path, const mode_t mode)
{ {
return git_futils_mkdir( return git_futils_mkdir(
...@@ -269,7 +271,7 @@ int git_futils_writebuffer( ...@@ -269,7 +271,7 @@ int git_futils_writebuffer(
flags &= ~O_FSYNC; flags &= ~O_FSYNC;
if (!mode) if (!mode)
mode = GIT_FILEMODE_BLOB; mode = GIT_FILEMODE_DEFAULT;
if ((fd = p_open(path, flags, mode)) < 0) { if ((fd = p_open(path, flags, mode)) < 0) {
git_error_set(GIT_ERROR_OS, "could not open '%s' for writing", path); git_error_set(GIT_ERROR_OS, "could not open '%s' for writing", path);
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "common.h" #include "common.h"
#include "git2/oid.h"
#include "hash/sha1.h" #include "hash/sha1.h"
typedef struct { typedef struct {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "netops.h" #include "netops.h"
#include <ctype.h> #include <ctype.h>
#include "git2/errors.h"
#include "posix.h" #include "posix.h"
#include "str.h" #include "str.h"
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include "common.h" #include "common.h"
#include "git2/common.h"
#if !defined(GIT_WIN32) && !defined(NO_MMAP) #if !defined(GIT_WIN32) && !defined(NO_MMAP)
#include "map.h" #include "map.h"
......
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
#ifndef INCLUDE_unix_posix_h__ #ifndef INCLUDE_unix_posix_h__
#define INCLUDE_unix_posix_h__ #define INCLUDE_unix_posix_h__
#ifndef LIBGIT2_NO_FEATURES_H #include "common.h"
# include "git2/sys/features.h"
#endif
#include <stdio.h> #include <stdio.h>
#include <dirent.h> #include <dirent.h>
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include "common.h" #include "common.h"
#include "git2/common.h"
#ifndef GIT_WIN32 #ifndef GIT_WIN32
#include <limits.h> #include <limits.h>
......
#include "clar_libgit2.h" #include "clar_libgit2.h"
#include "futils.h" #include "futils.h"
#include "path.h"
#include "posix.h" #include "posix.h"
void test_core_copy__file(void) void test_core_copy__file(void)
......
#include "clar_libgit2.h" #include "clar_libgit2.h"
#include "futils.h" #include "futils.h"
#include "sysdir.h" #include "sysdir.h"
#include "path.h"
#ifdef GIT_WIN32 #ifdef GIT_WIN32
#define NUM_VARS 5 #define NUM_VARS 5
......
#include "clar_libgit2.h" #include "clar_libgit2.h"
#include "posix.h" #include "posix.h"
#include "path.h"
#ifdef GIT_WIN32 #ifdef GIT_WIN32
# include "win32/reparse.h" # include "win32/reparse.h"
......
#include "clar_libgit2.h" #include "clar_libgit2.h"
#include "futils.h" #include "futils.h"
#include "path.h"
#include "posix.h" #include "posix.h"
static void cleanup_basic_dirs(void *ref) static void cleanup_basic_dirs(void *ref)
......
#include "clar_libgit2.h" #include "clar_libgit2.h"
#include "futils.h" #include "futils.h"
#include "path.h"
#include "posix.h" #include "posix.h"
void test_core_stat__initialize(void) void test_core_stat__initialize(void)
......
#include "clar_libgit2.h" #include "clar_libgit2.h"
#include "path.h"
#ifdef GIT_WIN32 #ifdef GIT_WIN32
#include "win32/path_w32.h" #include "win32/path_w32.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment