MCPcopy Index your code
hub / github.com/git/git / strbuf_complete

Function strbuf_complete

strbuf.h:661–665  ·  view source on GitHub ↗

* "Complete" the contents of `sb` by ensuring that either it ends with the * character `term`, or it is empty. This can be used, for example, * to ensure that text ends with a newline, but without creating an empty * blank line if there is no content in the first place. */

Source from the content-addressed store, hash-verified

659 * blank line if there is no content in the first place.
660 */
661static inline void strbuf_complete(struct strbuf *sb, char term)
662{
663 if (sb->len && sb->buf[sb->len - 1] != term)
664 strbuf_addch(sb, term);
665}
666
667static inline void strbuf_complete_line(struct strbuf *sb)
668{

Callers 15

is_git_directoryFunction · 0.85
copy_templatesFunction · 0.85
do_submodule_pathFunction · 0.85
submodule_to_gitdirFunction · 0.85
add_rebase_filesFunction · 0.85
safe_appendFunction · 0.85
treat_path_fastFunction · 0.85
remove_dir_recurseFunction · 0.85

Calls 1

strbuf_addchFunction · 0.85

Tested by

no test coverage detected