Skip to content

Commit 49cfd90

Browse files
matheustavaresgitster
authored andcommitted
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: Matheus Tavares <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d052cc0 commit 49cfd90

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

entry.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int create_file(const char *path, unsigned int mode)
8484
return open(path, O_WRONLY | O_CREAT | O_EXCL, mode);
8585
}
8686

87-
static void *read_blob_entry(const struct cache_entry *ce, unsigned long *size)
87+
void *read_blob_entry(const struct cache_entry *ce, unsigned long *size)
8888
{
8989
enum object_type type;
9090
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
109109
}
110110
}
111111

112-
static int fstat_output(int fd, const struct checkout *state, struct stat *st)
112+
int fstat_checkout_output(int fd, const struct checkout *state, struct stat *st)
113113
{
114114
/* use fstat() only when path == ce->name */
115115
if (fstat_is_reliable() &&
@@ -132,7 +132,7 @@ static int streaming_write_entry(const struct cache_entry *ce, char *path,
132132
return -1;
133133

134134
result |= stream_blob_to_fd(fd, &ce->oid, filter, 1);
135-
*fstat_done = fstat_output(fd, state, statbuf);
135+
*fstat_done = fstat_checkout_output(fd, state, statbuf);
136136
result |= close(fd);
137137

138138
if (result)
@@ -346,7 +346,7 @@ static int write_entry(struct cache_entry *ce,
346346

347347
wrote = write_in_full(fd, new_blob, size);
348348
if (!to_tempfile)
349-
fstat_done = fstat_output(fd, state, &st);
349+
fstat_done = fstat_checkout_output(fd, state, &st);
350350
close(fd);
351351
free(new_blob);
352352
if (wrote < 0)

entry.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ int finish_delayed_checkout(struct checkout *state, int *nr_checkouts);
3939
*/
4040
void unlink_entry(const struct cache_entry *ce);
4141

42+
void *read_blob_entry(const struct cache_entry *ce, unsigned long *size);
43+
int fstat_checkout_output(int fd, const struct checkout *state, struct stat *st);
44+
4245
#endif /* ENTRY_H */

0 commit comments

Comments
 (0)