Files
git/copy.h
Patrick Steinhardt 0717b3595d copy: drop dependency on the_repository
When copying a file we need to potentially adapt permissions of the new
file based on whether or not "core.shared" is enabled. Parsing this
configuration makes us implicitly depend on `the_repository`.

Refactor the code to instead require the caller to pass in a repository
so that we can remove `USE_THE_REPOSITORY_VARIABLE`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16 14:10:08 -07:00

15 lines
350 B
C

#ifndef COPY_H
#define COPY_H
struct repository;
#define COPY_READ_ERROR (-2)
#define COPY_WRITE_ERROR (-3)
int copy_fd(int ifd, int ofd);
int copy_file(struct repository *repo,
const char *dst, const char *src, int mode);
int copy_file_with_time(struct repository *repo,
const char *dst, const char *src, int mode);
#endif /* COPY_H */