Skip to content

Commit d5fff46

Browse files
newrengitster
authored andcommittedApr 24, 2023
copy.h: move declarations for copy.c functions from cache.h
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 623b80b commit d5fff46

14 files changed

+22
-6
lines changed
 

‎builtin/bisect.c

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "builtin.h"
22
#include "cache.h"
3+
#include "copy.h"
34
#include "environment.h"
45
#include "gettext.h"
56
#include "hex.h"

‎builtin/clone.c

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "abspath.h"
1414
#include "advice.h"
1515
#include "config.h"
16+
#include "copy.h"
1617
#include "environment.h"
1718
#include "gettext.h"
1819
#include "hex.h"

‎builtin/difftool.c

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "cache.h"
1616
#include "abspath.h"
1717
#include "config.h"
18+
#include "copy.h"
1819
#include "builtin.h"
1920
#include "run-command.h"
2021
#include "environment.h"

‎builtin/init-db.c

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "cache.h"
77
#include "abspath.h"
88
#include "config.h"
9+
#include "copy.h"
910
#include "environment.h"
1011
#include "gettext.h"
1112
#include "refs.h"

‎builtin/worktree.c

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "abspath.h"
33
#include "checkout.h"
44
#include "config.h"
5+
#include "copy.h"
56
#include "builtin.h"
67
#include "dir.h"
78
#include "environment.h"

‎bundle-uri.c

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "cache.h"
22
#include "bundle-uri.h"
33
#include "bundle.h"
4+
#include "copy.h"
45
#include "environment.h"
56
#include "gettext.h"
67
#include "object-store.h"

‎cache.h

-6
Original file line numberDiff line numberDiff line change
@@ -593,12 +593,6 @@ int df_name_compare(const char *name1, size_t len1, int mode1,
593593
int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
594594
int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
595595

596-
#define COPY_READ_ERROR (-2)
597-
#define COPY_WRITE_ERROR (-3)
598-
int copy_fd(int ifd, int ofd);
599-
int copy_file(const char *dst, const char *src, int mode);
600-
int copy_file_with_time(const char *dst, const char *src, int mode);
601-
602596
/* base85 */
603597
int decode_85(char *dst, const char *line, int linelen);
604598
void encode_85(char *buf, const unsigned char *data, int bytes);

‎convert.c

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "advice.h"
33
#include "config.h"
44
#include "convert.h"
5+
#include "copy.h"
56
#include "gettext.h"
67
#include "hex.h"
78
#include "object-store.h"

‎copy.c

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "cache.h"
2+
#include "copy.h"
23
#include "wrapper.h"
34

45
int copy_fd(int ifd, int ofd)

‎copy.h

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef COPY_H
2+
#define COPY_H
3+
4+
#define COPY_READ_ERROR (-2)
5+
#define COPY_WRITE_ERROR (-3)
6+
int copy_fd(int ifd, int ofd);
7+
int copy_file(const char *dst, const char *src, int mode);
8+
int copy_file_with_time(const char *dst, const char *src, int mode);
9+
10+
#endif /* COPY_H */

‎pkt-line.c

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "cache.h"
2+
#include "copy.h"
23
#include "pkt-line.h"
34
#include "gettext.h"
45
#include "hex.h"

‎refs/files-backend.c

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "../cache.h"
22
#include "../config.h"
3+
#include "../copy.h"
34
#include "../environment.h"
45
#include "../gettext.h"
56
#include "../hex.h"

‎rerere.c

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "abspath.h"
33
#include "alloc.h"
44
#include "config.h"
5+
#include "copy.h"
56
#include "gettext.h"
67
#include "hex.h"
78
#include "lockfile.h"

‎sequencer.c

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "advice.h"
44
#include "alloc.h"
55
#include "config.h"
6+
#include "copy.h"
67
#include "environment.h"
78
#include "gettext.h"
89
#include "hex.h"

0 commit comments

Comments
 (0)
Please sign in to comment.