提交 f0253a97 编写于 作者: M Matheus Tavares 提交者: Junio C Hamano

entry: make fstat_output() and read_blob_entry() public

These two functions will be used by the parallel checkout code, so let's
make them public. Note: fstat_output() is renamed to
fstat_checkout_output(), now that it has become public, seeking to avoid
future name collisions.
Signed-off-by: NMatheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 30246b3d
...@@ -84,7 +84,7 @@ static int create_file(const char *path, unsigned int mode) ...@@ -84,7 +84,7 @@ static int create_file(const char *path, unsigned int mode)
return open(path, O_WRONLY | O_CREAT | O_EXCL, mode); return open(path, O_WRONLY | O_CREAT | O_EXCL, mode);
} }
static void *read_blob_entry(const struct cache_entry *ce, unsigned long *size) void *read_blob_entry(const struct cache_entry *ce, unsigned long *size)
{ {
enum object_type type; enum object_type type;
void *blob_data = read_object_file(&ce->oid, &type, size); void *blob_data = read_object_file(&ce->oid, &type, size);
...@@ -109,7 +109,7 @@ static int open_output_fd(char *path, const struct cache_entry *ce, int to_tempf ...@@ -109,7 +109,7 @@ static int open_output_fd(char *path, const struct cache_entry *ce, int to_tempf
} }
} }
static int fstat_output(int fd, const struct checkout *state, struct stat *st) int fstat_checkout_output(int fd, const struct checkout *state, struct stat *st)
{ {
/* use fstat() only when path == ce->name */ /* use fstat() only when path == ce->name */
if (fstat_is_reliable() && if (fstat_is_reliable() &&
...@@ -132,7 +132,7 @@ static int streaming_write_entry(const struct cache_entry *ce, char *path, ...@@ -132,7 +132,7 @@ static int streaming_write_entry(const struct cache_entry *ce, char *path,
return -1; return -1;
result |= stream_blob_to_fd(fd, &ce->oid, filter, 1); result |= stream_blob_to_fd(fd, &ce->oid, filter, 1);
*fstat_done = fstat_output(fd, state, statbuf); *fstat_done = fstat_checkout_output(fd, state, statbuf);
result |= close(fd); result |= close(fd);
if (result) if (result)
...@@ -346,7 +346,7 @@ static int write_entry(struct cache_entry *ce, ...@@ -346,7 +346,7 @@ static int write_entry(struct cache_entry *ce,
wrote = write_in_full(fd, new_blob, size); wrote = write_in_full(fd, new_blob, size);
if (!to_tempfile) if (!to_tempfile)
fstat_done = fstat_output(fd, state, &st); fstat_done = fstat_checkout_output(fd, state, &st);
close(fd); close(fd);
free(new_blob); free(new_blob);
if (wrote < 0) if (wrote < 0)
......
...@@ -37,5 +37,7 @@ int finish_delayed_checkout(struct checkout *state, int *nr_checkouts); ...@@ -37,5 +37,7 @@ int finish_delayed_checkout(struct checkout *state, int *nr_checkouts);
* removal, such that empty directories get removed. * removal, such that empty directories get removed.
*/ */
void unlink_entry(const struct cache_entry *ce); void unlink_entry(const struct cache_entry *ce);
void *read_blob_entry(const struct cache_entry *ce, unsigned long *size);
int fstat_checkout_output(int fd, const struct checkout *state, struct stat *st);
#endif /* ENTRY_H */ #endif /* ENTRY_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册