summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-11-19 09:36:03 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2021-11-22 09:27:59 -0500
commitfc42c28ebe8bd4b524cc0f1594395a04b7d8e796 (patch)
treee85eb1d98772c2b4a17f511162c081a871cb75ae /src
parentea62f546dca580f366d1208e63c3aae26fdc9538 (diff)
downloadlibgit2-fc42c28ebe8bd4b524cc0f1594395a04b7d8e796.tar.gz
util: don't include unnecessary system libraries
Remove some unnecessary includes from utility code.
Diffstat (limited to 'src')
-rw-r--r--src/date.c1
-rw-r--r--src/fs_path.h2
-rw-r--r--src/futils.c6
-rw-r--r--src/hash.h1
-rw-r--r--src/net.c1
-rw-r--r--src/unix/map.c2
-rw-r--r--src/unix/posix.h4
-rw-r--r--src/unix/realpath.c2
8 files changed, 5 insertions, 14 deletions
diff --git a/src/date.c b/src/date.c
index 52cc30824..1529276e2 100644
--- a/src/date.c
+++ b/src/date.c
@@ -11,7 +11,6 @@
#endif
#include "util.h"
-#include "cache.h"
#include "posix.h"
#include "date.h"
diff --git a/src/fs_path.h b/src/fs_path.h
index 188dcf303..9720d34ce 100644
--- a/src/fs_path.h
+++ b/src/fs_path.h
@@ -14,8 +14,6 @@
#include "vector.h"
#include "utf8.h"
-#include "git2/sys/path.h"
-
/**
* Path manipulation utils
*
diff --git a/src/futils.c b/src/futils.c
index 7ec1009bd..454ed79de 100644
--- a/src/futils.c
+++ b/src/futils.c
@@ -15,6 +15,8 @@
#include "win32/findfile.h"
#endif
+#define GIT_FILEMODE_DEFAULT 0100666
+
int git_futils_mkpath2file(const char *file_path, const mode_t mode)
{
return git_futils_mkdir(
@@ -256,7 +258,7 @@ int git_futils_readbuffer(git_str *buf, const char *path)
}
int git_futils_writebuffer(
- const git_str *buf, const char *path, int flags, mode_t mode)
+ const git_str *buf, const char *path, int flags, mode_t mode)
{
int fd, do_fsync = 0, error = 0;
@@ -269,7 +271,7 @@ int git_futils_writebuffer(
flags &= ~O_FSYNC;
if (!mode)
- mode = GIT_FILEMODE_BLOB;
+ mode = GIT_FILEMODE_DEFAULT;
if ((fd = p_open(path, flags, mode)) < 0) {
git_error_set(GIT_ERROR_OS, "could not open '%s' for writing", path);
diff --git a/src/hash.h b/src/hash.h
index 10b14a904..2b2eaf6d6 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -10,7 +10,6 @@
#include "common.h"
-#include "git2/oid.h"
#include "hash/sha1.h"
typedef struct {
diff --git a/src/net.c b/src/net.c
index 58792ee7d..a91e7460e 100644
--- a/src/net.c
+++ b/src/net.c
@@ -9,7 +9,6 @@
#include "netops.h"
#include <ctype.h>
-#include "git2/errors.h"
#include "posix.h"
#include "str.h"
diff --git a/src/unix/map.c b/src/unix/map.c
index 88f283ce8..23fcb786e 100644
--- a/src/unix/map.c
+++ b/src/unix/map.c
@@ -7,8 +7,6 @@
#include "common.h"
-#include "git2/common.h"
-
#if !defined(GIT_WIN32) && !defined(NO_MMAP)
#include "map.h"
diff --git a/src/unix/posix.h b/src/unix/posix.h
index 7b3325e78..27a8fecd4 100644
--- a/src/unix/posix.h
+++ b/src/unix/posix.h
@@ -7,9 +7,7 @@
#ifndef INCLUDE_unix_posix_h__
#define INCLUDE_unix_posix_h__
-#ifndef LIBGIT2_NO_FEATURES_H
-# include "git2/sys/features.h"
-#endif
+#include "common.h"
#include <stdio.h>
#include <dirent.h>
diff --git a/src/unix/realpath.c b/src/unix/realpath.c
index 893bac87b..f1ca669f7 100644
--- a/src/unix/realpath.c
+++ b/src/unix/realpath.c
@@ -7,8 +7,6 @@
#include "common.h"
-#include "git2/common.h"
-
#ifndef GIT_WIN32
#include <limits.h>