repo: workdir_path implies no dotgit in init

When specifying a separate working directory path, the given repository
path should never have a `.git` directory created beneath it. That
simply doesn't make sense.

As a result, the `GIT_REPOSITORY_INIT_NO_DOTGIT_DIR` now _also_ no
longer makes sense. It would only ever be a sensible option when one
wanted a separate `.git` directory and working directory, otherwise the
git files and working directory files would be comingled. Remove the
option entirely.
This commit is contained in:
Edward Thomson
2024-12-27 15:36:06 +00:00
parent e9d97bedc2
commit ca2a241e4c
6 changed files with 19 additions and 19 deletions

View File

@@ -748,6 +748,17 @@ GIT_EXTERN(int) git_tag_create_frombuffer(
/**@}*/
/** @name Deprecated Repository Constants
*
* These enumeration values are retained for backward compatibility.
*/
/**
* @deprecated This option is deprecated; it is now implied when
* a separate working directory is specified to `git_repository_init`.
*/
#define GIT_REPOSITORY_INIT_NO_DOTGIT_DIR 0
/** @name Deprecated Revspec Constants
*
* These enumeration values are retained for backward compatibility.

View File

@@ -258,13 +258,6 @@ typedef enum {
*/
GIT_REPOSITORY_INIT_NO_REINIT = (1u << 1),
/**
* Normally a "/.git/" will be appended to the repo path for
* non-bare repos (if it is not already there), but passing this flag
* prevents that behavior.
*/
GIT_REPOSITORY_INIT_NO_DOTGIT_DIR = (1u << 2),
/**
* Make the repo_path (and workdir_path) as needed. Init is always willing
* to create the ".git" directory even without this flag. This flag tells