MCPcopy Create free account
hub / github.com/libgit2/pygit2 / RepositoryOpenFlag

Class RepositoryOpenFlag

pygit2/enums.py:1079–1132  ·  view source on GitHub ↗

Option flags for Repository.__init__().

Source from the content-addressed store, hash-verified

1077
1078
1079class RepositoryOpenFlag(IntFlag):
1080 """
1081 Option flags for Repository.__init__().
1082 """
1083
1084 DEFAULT = 0
1085 'Default flags.'
1086
1087 NO_SEARCH = C.GIT_REPOSITORY_OPEN_NO_SEARCH
1088 """
1089 Only open the repository if it can be immediately found in the
1090 start_path. Do not walk up from the start_path looking at parent
1091 directories.
1092 """
1093
1094 CROSS_FS = C.GIT_REPOSITORY_OPEN_CROSS_FS
1095 """
1096 Unless this flag is set, open will not continue searching across
1097 filesystem boundaries (i.e. when `st_dev` changes from the `stat`
1098 system call). For example, searching in a user's home directory at
1099 "/home/user/source/" will not return "/.git/" as the found repo if
1100 "/" is a different filesystem than "/home".
1101 """
1102
1103 BARE = C.GIT_REPOSITORY_OPEN_BARE
1104 """
1105 Open repository as a bare repo regardless of core.bare config, and
1106 defer loading config file for faster setup.
1107 Unlike `git_repository_open_bare`, this can follow gitlinks.
1108 """
1109
1110 NO_DOTGIT = C.GIT_REPOSITORY_OPEN_NO_DOTGIT
1111 """
1112 Do not check for a repository by appending /.git to the start_path;
1113 only open the repository if start_path itself points to the git
1114 directory.
1115 """
1116
1117 FROM_ENV = C.GIT_REPOSITORY_OPEN_FROM_ENV
1118 """
1119 Find and open a git repository, respecting the environment variables
1120 used by the git command-line tools.
1121 If set, `git_repository_open_ext` will ignore the other flags and
1122 the `ceiling_dirs` argument, and will allow a NULL `path` to use
1123 `GIT_DIR` or search from the current directory.
1124 The search for a repository will respect $GIT_CEILING_DIRECTORIES and
1125 $GIT_DISCOVERY_ACROSS_FILESYSTEM. The opened repository will
1126 respect $GIT_INDEX_FILE, $GIT_NAMESPACE, $GIT_OBJECT_DIRECTORY, and
1127 $GIT_ALTERNATE_OBJECT_DIRECTORIES.
1128 In the future, this flag will also cause `git_repository_open_ext`
1129 to respect $GIT_WORK_TREE and $GIT_COMMON_DIR; currently,
1130 `git_repository_open_ext` with this flag will error out if either
1131 $GIT_WORK_TREE or $GIT_COMMON_DIR is set.
1132 """
1133
1134
1135class RepositoryState(IntEnum):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…