Skip to content

Commit 4b0d1ee

Browse files
peffgitster
authored andcommitted
setup: document check_repository_format()
This function's interface is rather enigmatic, so let's document it further. While we're here, let's also drop the return value. It will always either be "0" or the function will die (consequently, neither of its two callers bothered to check the return). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ab5d01a commit 4b0d1ee

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

cache.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,14 @@ extern int grafts_replace_parents;
747747
#define GIT_REPO_VERSION_READ 1
748748
extern int repository_format_version;
749749
extern int repository_format_precious_objects;
750-
extern int check_repository_format(void);
750+
751+
/*
752+
* Check the repository format version in the path found in get_git_dir(),
753+
* and die if it is a version we don't understand. Generally one would
754+
* set_git_dir() before calling this, and use it only for "are we in a valid
755+
* repo?".
756+
*/
757+
extern void check_repository_format(void);
751758

752759
#define MTIME_CHANGED 0x0001
753760
#define CTIME_CHANGED 0x0002

setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,9 +982,9 @@ int check_repository_format_version(const char *var, const char *value, void *cb
982982
return 0;
983983
}
984984

985-
int check_repository_format(void)
985+
void check_repository_format(void)
986986
{
987-
return check_repository_format_gently(get_git_dir(), NULL);
987+
check_repository_format_gently(get_git_dir(), NULL);
988988
}
989989

990990
/*

0 commit comments

Comments
 (0)