1pub const GIT_BUILTIN_COMMANDS: &[&[u8]] = &[
40 b"add",
41 b"am",
42 b"annotate",
43 b"apply",
44 b"archive",
45 b"backfill",
46 b"bisect",
47 b"blame",
48 b"branch",
49 b"bugreport",
50 b"bundle",
51 b"cat-file",
52 b"check-attr",
53 b"check-ignore",
54 b"check-mailmap",
55 b"check-ref-format",
56 b"checkout",
57 b"checkout--worker",
58 b"checkout-index",
59 b"cherry",
60 b"cherry-pick",
61 b"clean",
62 b"clone",
63 b"column",
64 b"commit",
65 b"commit-graph",
66 b"commit-tree",
67 b"config",
68 b"count-objects",
69 b"credential",
70 b"credential-cache",
71 b"credential-cache--daemon",
72 b"credential-store",
73 b"describe",
74 b"diagnose",
75 b"diff",
76 b"diff-files",
77 b"diff-index",
78 b"diff-pairs",
79 b"diff-tree",
80 b"difftool",
81 b"fast-export",
82 b"fast-import",
83 b"fetch",
84 b"fetch-pack",
85 b"fmt-merge-msg",
86 b"for-each-ref",
87 b"for-each-repo",
88 b"format-patch",
89 b"format-rev",
90 b"fsck",
91 b"fsck-objects",
92 b"fsmonitor--daemon",
93 b"gc",
94 b"get-tar-commit-id",
95 b"grep",
96 b"hash-object",
97 b"help",
98 b"history",
99 b"hook",
100 b"index-pack",
101 b"init",
102 b"init-db",
103 b"interpret-trailers",
104 b"last-modified",
105 b"log",
106 b"ls-files",
107 b"ls-remote",
108 b"ls-tree",
109 b"mailinfo",
110 b"mailsplit",
111 b"maintenance",
112 b"merge",
113 b"merge-base",
114 b"merge-file",
115 b"merge-index",
116 b"merge-ours",
117 b"merge-recursive",
118 b"merge-recursive-ours",
119 b"merge-recursive-theirs",
120 b"merge-subtree",
121 b"merge-tree",
122 b"mktag",
123 b"mktree",
124 b"multi-pack-index",
125 b"mv",
126 b"name-rev",
127 b"notes",
128 b"pack-objects",
129 b"pack-redundant",
130 b"pack-refs",
131 b"patch-id",
132 b"pickaxe",
133 b"prune",
134 b"prune-packed",
135 b"pull",
136 b"push",
137 b"range-diff",
138 b"read-tree",
139 b"rebase",
140 b"receive-pack",
141 b"reflog",
142 b"refs",
143 b"remote",
144 b"remote-ext",
145 b"remote-fd",
146 b"repack",
147 b"replace",
148 b"replay",
149 b"repo",
150 b"rerere",
151 b"reset",
152 b"restore",
153 b"rev-list",
154 b"rev-parse",
155 b"revert",
156 b"rm",
157 b"send-pack",
158 b"shortlog",
159 b"show",
160 b"show-branch",
161 b"show-index",
162 b"show-ref",
163 b"sparse-checkout",
164 b"stage",
165 b"stash",
166 b"status",
167 b"stripspace",
168 b"submodule--helper",
169 b"switch",
170 b"symbolic-ref",
171 b"tag",
172 b"unpack-file",
173 b"unpack-objects",
174 b"update-index",
175 b"update-ref",
176 b"update-server-info",
177 b"upload-archive",
178 b"upload-archive--writer",
179 b"upload-pack",
180 b"url-parse",
181 b"var",
182 b"verify-commit",
183 b"verify-pack",
184 b"verify-tag",
185 b"version",
186 b"whatchanged",
187 b"worktree",
188 b"write-tree",
189];
190
191pub fn is_git_builtin(word: &[u8]) -> bool {
205 return GIT_BUILTIN_COMMANDS.contains(&word);
207}
208
209#[cfg(test)]
211#[path = "git_builtins_tests.rs"]
212mod tests;