Expand description
Submodule gitdir paths when extensions.submodulePathConfig is enabled.
Mirrors Git’s create_default_gitdir_config / validate_submodule_git_dir logic
enough for upstream tests (encoded paths, nesting checks, conflict resolution).
Functions§
- compute_
default_ submodule_ gitdir - Computes
submodule.<name>.gitdiras a path relative to the work tree when not already set. - connect_
submodule_ work_ tree_ and_ git_ dir - Writes the gitfile and
core.worktreefor a submodule using configuredsubmodule.<name>.gitdir. - die_
path_ inside_ submodule_ when_ disabled - Fails when
submodulePathConfigis off andnew_pathwould nest inside an existing submodule. - ensure_
submodule_ gitdir_ config - Ensures
submodule.<name>.gitdirexists, writing it viacompute_default_submodule_gitdirif needed. - hash_
blob_ sha1_ hex - Returns the 40-character hex SHA-1 of a blob object for
data(same asgit hash-object). - init_
submodule_ head_ from_ gitlink - If
modules_dir/HEADis missing, sets it tooid_hexwhen that commit exists inobjects/. - is_
git_ directory - Returns true if
pathlooks like a git directory (HEADandobjects/exist). - migrate_
gitdir_ configs - Migrates legacy submodule dirs under
.git/modules/: setssubmodule.*.gitdirand enables the extension. - path_
inside_ indexed_ submodule - Returns true if
new_pathis strictly inside a gitlink path recorded inindex(stage 0). - path_
inside_ registered_ submodule - Returns true if
new_pathis under a submodule path declared in.gitmodules. - path_
inside_ registered_ submodule_ name - True when
new_pathis the same as or nested under a.gitmodulessubmodule name (thesubmodule.<name>.*section name), which may contain/. - set_
submodule_ repo_ worktree - Sets
core.worktreein the submodule repo atmodules_dirviagrit --git-dir. - submodule_
gitdir_ filesystem_ path - Resolves the absolute filesystem path of a submodule’s git directory.
- submodule_
gitdir_ outer_ conflict - When a proposed
.git/modules/<name>path would sit inside another submodule’s git dir (e.g. nameshippoandhippo/hooks), returns the outer git directory path (Gitvalidate_submodule_legacy_git_dir). - submodule_
modules_ git_ dir - Filesystem path to the separate git directory for a submodule under
super_git_dir. - submodule_
path_ config_ enabled - Returns whether
extensions.submodulePathConfigis enabled ingit_dir/config. - validate_
encoded_ submodule_ git_ dir - Validates an encoded submodule gitdir path when
submodulePathConfigis enabled. - validate_
legacy_ submodule_ git_ dir - Validates a legacy submodule gitdir path (extension disabled): name suffix and no nesting clash.
- validate_
submodule_ path - Rejects submodule paths that traverse symlinks (Git
validate_submodule_path). - write_
submodule_ gitfile - Writes
sub_worktree/.gitas a gitfile pointing atmodules_dir(relative when possible).