-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
entry: extract a header file for entry.c functions
The declarations of entry.c's public functions and structures currently reside in cache.h. Although not many, they contribute to the size of cache.h and, when changed, cause the unnecessary recompilation of modules that don't really use these functions. So let's move them to a new entry.h header. While at it let's also move a comment related to checkout_entry() from entry.c to entry.h as it's more useful to describe the function there. Original-patch-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
1 parent
f59d15b
commit d052cc0
Showing
9 changed files
with
49 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#ifndef ENTRY_H | ||
#define ENTRY_H | ||
|
||
#include "cache.h" | ||
#include "convert.h" | ||
|
||
struct checkout { | ||
struct index_state *istate; | ||
const char *base_dir; | ||
int base_dir_len; | ||
struct delayed_checkout *delayed_checkout; | ||
struct checkout_metadata meta; | ||
unsigned force:1, | ||
quiet:1, | ||
not_new:1, | ||
clone:1, | ||
refresh_cache:1; | ||
}; | ||
#define CHECKOUT_INIT { NULL, "" } | ||
|
||
#define TEMPORARY_FILENAME_LENGTH 25 | ||
/* | ||
* Write the contents from ce out to the working tree. | ||
* | ||
* When topath[] is not NULL, instead of writing to the working tree | ||
* file named by ce, a temporary file is created by this function and | ||
* its name is returned in topath[], which must be able to hold at | ||
* least TEMPORARY_FILENAME_LENGTH bytes long. | ||
*/ | ||
int checkout_entry(struct cache_entry *ce, const struct checkout *state, | ||
char *topath, int *nr_checkouts); | ||
|
||
void enable_delayed_checkout(struct checkout *state); | ||
int finish_delayed_checkout(struct checkout *state, int *nr_checkouts); | ||
|
||
/* | ||
* Unlink the last component and schedule the leading directories for | ||
* removal, such that empty directories get removed. | ||
*/ | ||
void unlink_entry(const struct cache_entry *ce); | ||
|
||
#endif /* ENTRY_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters