Skip to content

Commit 82c9d66

Browse files
peffgitster
authored andcommitted
move odb_* declarations out of git-compat-util.h
These functions were originally conceived as wrapper functions similar to xmkstemp(). They were later moved by 463db9b (wrapper: move odb_* to environment.c, 2010-11-06). The more appropriate place for a declaration is in cache.h. While we're at it, let's add some basic docstrings. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e7e07d5 commit 82c9d66

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

cache.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,18 @@ extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
15631563

15641564
extern void pack_report(void);
15651565

1566+
/*
1567+
* Create a temporary file rooted in the object database directory.
1568+
*/
1569+
extern int odb_mkstemp(char *template, size_t limit, const char *pattern);
1570+
1571+
/*
1572+
* Create a pack .keep file in the object database's pack directory, for
1573+
* a pack with checksum "sha1". The return value is a file descriptor opened
1574+
* for writing, or -1 on error. The name of the keep file is written to "name".
1575+
*/
1576+
extern int odb_pack_keep(char *name, size_t namesz, const unsigned char *sha1);
1577+
15661578
/*
15671579
* mmap the index file for the specified packfile (if it is not
15681580
* already mmapped). Return 0 on success.

git-compat-util.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,6 @@ extern FILE *xfopen(const char *path, const char *mode);
803803
extern FILE *xfdopen(int fd, const char *mode);
804804
extern int xmkstemp(char *template);
805805
extern int xmkstemp_mode(char *template, int mode);
806-
extern int odb_mkstemp(char *template, size_t limit, const char *pattern);
807-
extern int odb_pack_keep(char *name, size_t namesz, const unsigned char *sha1);
808806
extern char *xgetcwd(void);
809807
extern FILE *fopen_for_writing(const char *path);
810808

0 commit comments

Comments
 (0)