diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2020-02-22 21:17:38 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-24 18:33:27 +0100 |
commit | 8b8f7189dff1f9ee2e3d65dfaafc2fc9f4956232 (patch) | |
tree | b2b47df52f8a974a46d4301a58adf478d6513174 /cache.h | |
parent | setup: allow check_repository_format to read repository format (diff) | |
download | git-8b8f7189dff1f9ee2e3d65dfaafc2fc9f4956232.tar.xz git-8b8f7189dff1f9ee2e3d65dfaafc2fc9f4956232.zip |
builtin/init-db: allow specifying hash algorithm on command line
Allow the user to specify the hash algorithm on the command line by
using the --object-format option to git init. Validate that the user is
not attempting to reinitialize a repository with a different hash
algorithm. Ensure that if we are writing a non-SHA-1 repository that we
set the repository version to 1 and write the objectFormat extension.
Restrict this option to work only when ENABLE_SHA256 is set until the
codebase is in a situation to fully support this.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -627,7 +627,8 @@ int path_inside_repo(const char *prefix, const char *path); #define INIT_DB_EXIST_OK 0x0002 int init_db(const char *git_dir, const char *real_git_dir, - const char *template_dir, unsigned int flags); + const char *template_dir, int hash_algo, + unsigned int flags); void sanitize_stdfds(void); int daemonize(void); |