这篇教程C++ strbuf_detach函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中strbuf_detach函数的典型用法代码示例。如果您正苦于以下问题:C++ strbuf_detach函数的具体用法?C++ strbuf_detach怎么用?C++ strbuf_detach使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了strbuf_detach函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: populate_from_stdinstatic int populate_from_stdin(struct diff_filespec *s){ struct strbuf buf = STRBUF_INIT; size_t size = 0; if (strbuf_read(&buf, 0, 0) < 0) return error_errno("error while reading from stdin"); s->should_munmap = 0; s->data = strbuf_detach(&buf, &size); s->size = size; s->should_free = 1; s->is_stdin = 1; return 0;}
开发者ID:MichaelBlume,项目名称:git,代码行数:15,
示例2: memsetstatic const char *map_refspec(const char *ref, struct remote *remote, struct ref *local_refs){ struct ref *matched = NULL; /* Does "ref" uniquely name our ref? */ if (count_refspec_match(ref, local_refs, &matched) != 1) return ref; if (remote->push) { struct refspec query; memset(&query, 0, sizeof(struct refspec)); query.src = matched->name; if (!query_refspecs(remote->push, remote->push_refspec_nr, &query) && query.dst) { struct strbuf buf = STRBUF_INIT; strbuf_addf(&buf, "%s%s:%s", query.force ? "+" : "", query.src, query.dst); return strbuf_detach(&buf, NULL); } } if (push_default == PUSH_DEFAULT_UPSTREAM && starts_with(matched->name, "refs/heads/")) { struct branch *branch = branch_get(matched->name + 11); if (branch->merge_nr == 1 && branch->merge[0]->src) { struct strbuf buf = STRBUF_INIT; strbuf_addf(&buf, "%s:%s", ref, branch->merge[0]->src); return strbuf_detach(&buf, NULL); } } return ref;}
开发者ID:80520997,项目名称:git,代码行数:36,
示例3: chunk_trimunsigned char *cmark_clean_autolink(chunk *url, int is_email){ strbuf buf = GH_BUF_INIT; chunk_trim(url); if (url->len == 0) return NULL; if (is_email) strbuf_puts(&buf, "mailto:"); houdini_unescape_html_f(&buf, url->data, url->len); return strbuf_detach(&buf);}
开发者ID:llxwj,项目名称:CommonMark,代码行数:15,
示例4: get_termsstatic int get_terms(struct bisect_terms *terms){ struct strbuf str = STRBUF_INIT; FILE *fp = NULL; int res = 0; fp = fopen(git_path_bisect_terms(), "r"); if (!fp) { res = -1; goto finish; } free_terms(terms); strbuf_getline_lf(&str, fp); terms->term_bad = strbuf_detach(&str, NULL); strbuf_getline_lf(&str, fp); terms->term_good = strbuf_detach(&str, NULL);finish: if (fp) fclose(fp); strbuf_release(&str); return res;}
开发者ID:bk2204,项目名称:git,代码行数:24,
示例5: read_bisect_terms/* * The terms used for this bisect session are stored in BISECT_TERMS. * We read them and store them to adapt the messages accordingly. * Default is bad/good. */void read_bisect_terms(const char **read_bad, const char **read_good){ struct strbuf str = STRBUF_INIT; const char *filename = git_path("BISECT_TERMS"); FILE *fp = fopen(filename, "r"); if (!fp) { if (errno == ENOENT) { *read_bad = "bad"; *read_good = "good"; return; } else { die("could not read file '%s': %s", filename, strerror(errno)); } } else { strbuf_getline(&str, fp, '/n'); *read_bad = strbuf_detach(&str, NULL); strbuf_getline(&str, fp, '/n'); *read_good = strbuf_detach(&str, NULL); } strbuf_release(&str); fclose(fp);}
开发者ID:Lekensteyn,项目名称:git,代码行数:29,
示例6: check_signatureint check_signature(const char *payload, size_t plen, const char *signature, size_t slen, struct signature_check *sigc){ struct strbuf gpg_output = STRBUF_INIT; struct strbuf gpg_status = STRBUF_INIT; int status; sigc->result = 'N'; status = verify_signed_buffer(payload, plen, signature, slen, &gpg_output, &gpg_status); if (status && !gpg_output.len) goto out; sigc->payload = xmemdupz(payload, plen); sigc->gpg_output = strbuf_detach(&gpg_output, NULL); sigc->gpg_status = strbuf_detach(&gpg_status, NULL); parse_gpg_output(sigc); out: strbuf_release(&gpg_status); strbuf_release(&gpg_output); return sigc->result != 'G' && sigc->result != 'U';}
开发者ID:DoWonJin,项目名称:git,代码行数:24,
示例7: parse_opt_passthru/** * For an option opt, recreates the command-line option in opt->value which * must be an char* initialized to NULL. This is useful when we need to pass * the command-line option to another command. Since any previous value will be * overwritten, this callback should only be used for options where the last * one wins. */int parse_opt_passthru(const struct option *opt, const char *arg, int unset){ static struct strbuf sb = STRBUF_INIT; char **opt_value = opt->value; if (recreate_opt(&sb, opt, arg, unset) < 0) return -1; if (*opt_value) free(*opt_value); *opt_value = strbuf_detach(&sb, NULL); return 0;}
开发者ID:64octets,项目名称:git,代码行数:22,
示例8: strbuf_addfstatic char *unable_to_lock_message(const char *path, int err){ struct strbuf buf = STRBUF_INIT; if (err == EEXIST) { strbuf_addf(&buf, "Unable to create '%s.lock': %s./n/n" "If no other git process is currently running, this probably means a/n" "git process crashed in this repository earlier. Make sure no other git/n" "process is running and remove the file manually to continue.", absolute_path(path), strerror(err)); } else strbuf_addf(&buf, "Unable to create '%s.lock': %s", absolute_path(path), strerror(err)); return strbuf_detach(&buf, NULL);}
开发者ID:CookieChen,项目名称:git,代码行数:15,
示例9: strbuf_addfstatic const char *disambiguate_ref(const char *ref, int *must_free_result){ unsigned char sha1[20]; struct strbuf longref = STRBUF_INIT; strbuf_addf(&longref, "refs/heads/%s", ref); if (get_sha1(longref.buf, sha1) == 0) { *must_free_result = 1; return strbuf_detach(&longref, NULL); } *must_free_result = 0; strbuf_release(&longref); return ref;}
开发者ID:gurugeek,项目名称:cgit,代码行数:15,
示例10: insert_one_recordstatic void insert_one_record(struct shortlog *log, const char *author, const char *oneline){ struct string_list_item *item; item = string_list_insert(&log->list, author); if (log->summary) item->util = (void *)(UTIL_TO_INT(item) + 1); else { const char *dot3 = log->common_repo_prefix; char *buffer, *p; struct strbuf subject = STRBUF_INIT; const char *eol; /* Skip any leading whitespace, including any blank lines. */ while (*oneline && isspace(*oneline)) oneline++; eol = strchr(oneline, '/n'); if (!eol) eol = oneline + strlen(oneline); if (starts_with(oneline, "[PATCH")) { char *eob = strchr(oneline, ']'); if (eob && (!eol || eob < eol)) oneline = eob + 1; } while (*oneline && isspace(*oneline) && *oneline != '/n') oneline++; format_subject(&subject, oneline, " "); buffer = strbuf_detach(&subject, NULL); if (dot3) { int dot3len = strlen(dot3); if (dot3len > 5) { while ((p = strstr(buffer, dot3)) != NULL) { int taillen = strlen(p) - dot3len; memcpy(p, "/.../", 5); memmove(p + 5, p + dot3len, taillen + 1); } } } if (item->util == NULL) item->util = xcalloc(1, sizeof(struct string_list)); string_list_append(item->util, buffer); }}
开发者ID:Nowher2,项目名称:git,代码行数:48,
示例11: mktree_linestatic void mktree_line(char *buf, size_t len, int line_termination, int allow_missing){ char *ptr, *ntr; unsigned mode; enum object_type mode_type; /* object type derived from mode */ enum object_type obj_type; /* object type derived from sha */ char *path; unsigned char sha1[20]; ptr = buf; /* * Read non-recursive ls-tree output format: * mode SP type SP sha1 TAB name */ mode = strtoul(ptr, &ntr, 8); if (ptr == ntr || !ntr || *ntr != ' ') die("input format error: %s", buf); ptr = ntr + 1; /* type */ ntr = strchr(ptr, ' '); if (!ntr || buf + len <= ntr + 40 || ntr[41] != '/t' || get_sha1_hex(ntr + 1, sha1)) die("input format error: %s", buf); /* It is perfectly normal if we do not have a commit from a submodule */ if (S_ISGITLINK(mode)) allow_missing = 1; *ntr++ = 0; /* now at the beginning of SHA1 */ path = ntr + 41; /* at the beginning of name */ if (line_termination && path[0] == '"') { struct strbuf p_uq = STRBUF_INIT; if (unquote_c_style(&p_uq, path, NULL)) die("invalid quoting"); path = strbuf_detach(&p_uq, NULL); } /* * Object type is redundantly derivable three ways. * These should all agree. */ mode_type = object_type(mode); if (mode_type != type_from_string(ptr)) { die("entry '%s' object type (%s) doesn't match mode type (%s)", path, ptr, typename(mode_type)); }
开发者ID:00027jang27,项目名称:git,代码行数:48,
示例12: strbuf_addfstatic char *find_linked_symref(const char *symref, const char *branch, const char *id){ struct strbuf sb = STRBUF_INIT; struct strbuf path = STRBUF_INIT; struct strbuf gitdir = STRBUF_INIT; char *existing = NULL; /* * $GIT_COMMON_DIR/$symref (e.g. HEAD) is practically outside * $GIT_DIR so resolve_ref_unsafe() won't work (it uses * git_path). Parse the ref ourselves. */ if (id) strbuf_addf(&path, "%s/worktrees/%s/%s", get_git_common_dir(), id, symref); else strbuf_addf(&path, "%s/%s", get_git_common_dir(), symref); if (!strbuf_readlink(&sb, path.buf, 0)) { if (!starts_with(sb.buf, "refs/") || check_refname_format(sb.buf, 0)) goto done; } else if (strbuf_read_file(&sb, path.buf, 0) >= 0 && starts_with(sb.buf, "ref:")) { strbuf_remove(&sb, 0, strlen("ref:")); strbuf_trim(&sb); } else goto done; if (strcmp(sb.buf, branch)) goto done; if (id) { strbuf_reset(&path); strbuf_addf(&path, "%s/worktrees/%s/gitdir", get_git_common_dir(), id); if (strbuf_read_file(&gitdir, path.buf, 0) <= 0) goto done; strbuf_rtrim(&gitdir); } else strbuf_addstr(&gitdir, get_git_common_dir()); strbuf_strip_suffix(&gitdir, ".git"); existing = strbuf_detach(&gitdir, NULL);done: strbuf_release(&path); strbuf_release(&sb); strbuf_release(&gitdir); return existing;}
开发者ID:2quala,项目名称:git,代码行数:48,
示例13: update_worktree_locationvoid update_worktree_location(struct worktree *wt, const char *path_){ struct strbuf path = STRBUF_INIT; if (is_main_worktree(wt)) BUG("can't relocate main worktree"); strbuf_realpath(&path, path_, 1); if (fspathcmp(wt->path, path.buf)) { write_file(git_common_path("worktrees/%s/gitdir", wt->id), "%s/.git", path.buf); free(wt->path); wt->path = strbuf_detach(&path, NULL); } strbuf_release(&path);}
开发者ID:PhilipOakley,项目名称:git,代码行数:16,
示例14: cmark_parse_documentunsigned char *cmark_markdown_to_html(unsigned char *text, int len){ node_block *blocks; strbuf htmlbuf = GH_BUF_INIT; unsigned char *result; blocks = cmark_parse_document(text, len); cmark_render_html(&htmlbuf, blocks); cmark_free_blocks(blocks); result = strbuf_detach(&htmlbuf); strbuf_free(&htmlbuf); return result;}
开发者ID:Knagis,项目名称:CommonMark,代码行数:16,
示例15: repo_set_commondirstatic void repo_set_commondir(struct repository *repo, const char *commondir){ struct strbuf sb = STRBUF_INIT; free(repo->commondir); if (commondir) { repo->different_commondir = 1; repo->commondir = xstrdup(commondir); return; } repo->different_commondir = get_common_dir_noenv(&sb, repo->gitdir); repo->commondir = strbuf_detach(&sb, NULL);}
开发者ID:DoWonJin,项目名称:git,代码行数:16,
示例16: fopenstatic char *read_line_from_git_path(const char *filename){ struct strbuf buf = STRBUF_INIT; FILE *fp = fopen(git_path("%s", filename), "r"); if (!fp) { strbuf_release(&buf); return NULL; } strbuf_getline(&buf, fp, '/n'); if (!fclose(fp)) { return strbuf_detach(&buf, NULL); } else { strbuf_release(&buf); return NULL; }}
开发者ID:ANKIT-KS,项目名称:git,代码行数:16,
示例17: put_object_namestatic void put_object_name(struct fsck_options *options, struct object *obj, const char *fmt, ...){ va_list ap; struct strbuf buf = STRBUF_INIT; char *existing; if (!options->object_names) return; existing = lookup_decoration(options->object_names, obj); if (existing) return; va_start(ap, fmt); strbuf_vaddf(&buf, fmt, ap); add_decoration(options->object_names, obj, strbuf_detach(&buf, NULL)); va_end(ap);}
开发者ID:PEPE-coin,项目名称:git,代码行数:17,
示例18: diestatic struct worktree *get_linked_worktree(const char *id){ struct worktree *worktree = NULL; struct strbuf path = STRBUF_INIT; struct strbuf worktree_path = STRBUF_INIT; struct strbuf head_ref = STRBUF_INIT; int is_detached = 0; if (!id) die("Missing linked worktree name"); strbuf_git_common_path(&path, "worktrees/%s/gitdir", id); if (strbuf_read_file(&worktree_path, path.buf, 0) <= 0) /* invalid gitdir file */ goto done; strbuf_rtrim(&worktree_path); if (!strbuf_strip_suffix(&worktree_path, "/.git")) { strbuf_reset(&worktree_path); strbuf_add_absolute_path(&worktree_path, "."); strbuf_strip_suffix(&worktree_path, "/."); } strbuf_reset(&path); strbuf_addf(&path, "%s/worktrees/%s/HEAD", get_git_common_dir(), id); if (parse_ref(path.buf, &head_ref, &is_detached) < 0) goto done; worktree = xmalloc(sizeof(struct worktree)); worktree->path = strbuf_detach(&worktree_path, NULL); worktree->id = xstrdup(id); worktree->is_bare = 0; worktree->head_ref = NULL; worktree->is_detached = is_detached; worktree->is_current = 0; add_head_info(&head_ref, worktree); worktree->lock_reason = NULL; worktree->lock_reason_valid = 0;done: strbuf_release(&path); strbuf_release(&worktree_path); strbuf_release(&head_ref); return worktree;}
开发者ID:9b,项目名称:git,代码行数:46,
示例19: getenv// taken from msysgit: compat/mingw.cconst char *get_windows_home_directory(void){ static const char *home_directory = NULL; struct strbuf buf = STRBUF_INIT; if (home_directory) return home_directory; home_directory = getenv("HOME"); if (home_directory && *home_directory) return home_directory; strbuf_addf(&buf, "%s%s", getenv("HOMEDRIVE"), getenv("HOMEPATH")); home_directory = strbuf_detach(&buf, NULL); return home_directory;}
开发者ID:DinaraRigon,项目名称:TortoiseGit,代码行数:18,
示例20: wt_status_print_submodule_summarystatic void wt_status_print_submodule_summary(struct wt_status *s, int uncommitted){ struct child_process sm_summary = CHILD_PROCESS_INIT; struct strbuf cmd_stdout = STRBUF_INIT; struct strbuf summary = STRBUF_INIT; char *summary_content; argv_array_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s", s->index_file); argv_array_push(&sm_summary.args, "submodule"); argv_array_push(&sm_summary.args, "summary"); argv_array_push(&sm_summary.args, uncommitted ? "--files" : "--cached"); argv_array_push(&sm_summary.args, "--for-status"); argv_array_push(&sm_summary.args, "--summary-limit"); argv_array_pushf(&sm_summary.args, "%d", s->submodule_summary); if (!uncommitted) argv_array_push(&sm_summary.args, s->amend ? "HEAD^" : "HEAD"); sm_summary.git_cmd = 1; sm_summary.no_stdin = 1; capture_command(&sm_summary, &cmd_stdout, 1024); /* prepend header, only if there's an actual output */ if (cmd_stdout.len) { if (uncommitted) strbuf_addstr(&summary, _("Submodules changed but not updated:")); else strbuf_addstr(&summary, _("Submodule changes to be committed:")); strbuf_addstr(&summary, "/n/n"); } strbuf_addbuf(&summary, &cmd_stdout); strbuf_release(&cmd_stdout); if (s->display_comment_prefix) { size_t len; summary_content = strbuf_detach(&summary, &len); strbuf_add_commented_lines(&summary, summary_content, len); free(summary_content); } fputs(summary.buf, s->fp); strbuf_release(&summary);}
开发者ID:Lekensteyn,项目名称:git,代码行数:45,
示例21: repo_setup_envstatic void repo_setup_env(struct repository *repo){ struct strbuf sb = STRBUF_INIT; repo->different_commondir = find_common_dir(&sb, repo->gitdir, !repo->ignore_env); free(repo->commondir); repo->commondir = strbuf_detach(&sb, NULL); free(repo->objectdir); repo->objectdir = git_path_from_env(DB_ENVIRONMENT, repo->commondir, "objects", !repo->ignore_env); free(repo->graft_file); repo->graft_file = git_path_from_env(GRAFT_ENVIRONMENT, repo->commondir, "info/grafts", !repo->ignore_env); free(repo->index_file); repo->index_file = git_path_from_env(INDEX_ENVIRONMENT, repo->gitdir, "index", !repo->ignore_env);}
开发者ID:alexcomplex,项目名称:git,代码行数:18,
示例22: resolve_refstatic char *guess_ref(const char *name, struct ref *peer){ struct strbuf buf = STRBUF_INIT; unsigned char sha1[20]; const char *r = resolve_ref(peer->name, sha1, 1, NULL); if (!r) return NULL; if (!prefixcmp(r, "refs/heads/")) strbuf_addstr(&buf, "refs/heads/"); else if (!prefixcmp(r, "refs/tags/")) strbuf_addstr(&buf, "refs/tags/"); else return NULL; strbuf_addstr(&buf, name); return strbuf_detach(&buf, NULL);}
开发者ID:certik,项目名称:git,代码行数:19,
示例23: strbuf_addfchar *cgit_fileurl(const char *reponame, const char *pagename, const char *filename, const char *query){ struct strbuf sb = STRBUF_INIT; char *delim; if (ctx.cfg.virtual_root) { strbuf_addf(&sb, "%s%s/%s/%s", ctx.cfg.virtual_root, reponame, pagename, (filename ? filename:"")); delim = "?"; } else { strbuf_addf(&sb, "?url=%s/%s/%s", reponame, pagename, (filename ? filename : "")); delim = "&"; } if (query) strbuf_addf(&sb, "%s%s", delim, query); return strbuf_detach(&sb, NULL);}
开发者ID:ifzz,项目名称:cgit,代码行数:19,
示例24: switchconst char *submodule_strategy_to_string(const struct submodule_update_strategy *s){ struct strbuf sb = STRBUF_INIT; switch (s->type) { case SM_UPDATE_CHECKOUT: return "checkout"; case SM_UPDATE_MERGE: return "merge"; case SM_UPDATE_REBASE: return "rebase"; case SM_UPDATE_NONE: return "none"; case SM_UPDATE_UNSPECIFIED: return NULL; case SM_UPDATE_COMMAND: strbuf_addf(&sb, "!%s", s->command); return strbuf_detach(&sb, NULL); } return NULL;}
开发者ID:136357477,项目名称:git,代码行数:20,
示例25: xcallocstatic struct child_process *get_helper(struct transport *transport){ struct helper_data *data = transport->data; struct strbuf buf = STRBUF_INIT; struct child_process *helper; if (data->helper) return data->helper; helper = xcalloc(1, sizeof(*helper)); helper->in = -1; helper->out = -1; helper->err = 0; helper->argv = xcalloc(4, sizeof(*helper->argv)); strbuf_addf(&buf, "remote-%s", data->name); helper->argv[0] = strbuf_detach(&buf, NULL); helper->argv[1] = transport->remote->name; helper->argv[2] = transport->url; helper->git_cmd = 1; if (start_command(helper)) die("Unable to run helper: git %s", helper->argv[0]); data->helper = helper; write_str_in_full(helper->in, "capabilities/n"); data->out = xfdopen(helper->out, "r"); while (1) { if (strbuf_getline(&buf, data->out, '/n') == EOF) exit(128); /* child died, message supplied already */ if (!*buf.buf) break; if (!strcmp(buf.buf, "fetch")) data->fetch = 1; if (!strcmp(buf.buf, "option")) data->option = 1; if (!strcmp(buf.buf, "push")) data->push = 1; } return data->helper;}
开发者ID:samv,项目名称:git,代码行数:41,
示例26: collect_expectstatic int collect_expect(const struct option *opt, const char *arg, int unset){ struct string_list *expect; struct string_list_item *item; struct strbuf label = STRBUF_INIT; const char *colon; if (!arg || unset) die("malformed --expect option"); expect = (struct string_list *)opt->value; colon = strchr(arg, ':'); if (!colon) die("malformed --expect option, lacking a colon"); strbuf_add(&label, arg, colon - arg); item = string_list_insert(expect, strbuf_detach(&label, NULL)); if (item->util) die("malformed --expect option, duplicate %s", label.buf); item->util = (void *)arg; return 0;}
开发者ID:yukino6223,项目名称:git,代码行数:21,
示例27: file_callbackstatic int file_callback(const struct option *opt, const char *arg, int unset){ struct grep_opt *grep_opt = opt->value; FILE *patterns; int lno = 0; struct strbuf sb = STRBUF_INIT; patterns = fopen(arg, "r"); if (!patterns) die_errno("cannot open '%s'", arg); while (strbuf_getline(&sb, patterns, '/n') == 0) { /* ignore empty line like grep does */ if (sb.len == 0) continue; append_grep_pattern(grep_opt, strbuf_detach(&sb, NULL), arg, ++lno, GREP_PATTERN); } fclose(patterns); strbuf_release(&sb); return 0;}
开发者ID:jaswope,项目名称:git,代码行数:21,
示例28: read_sha1_filestatic void *sha1_file_to_archive(const char *path, const unsigned char *sha1, unsigned int mode, enum object_type *type, unsigned long *sizep, const struct commit *commit){ void *buffer; buffer = read_sha1_file(sha1, type, sizep); if (buffer && S_ISREG(mode)) { struct strbuf buf = STRBUF_INIT; size_t size = 0; strbuf_attach(&buf, buffer, *sizep, *sizep + 1); convert_to_working_tree(path, buf.buf, buf.len, &buf); if (commit) format_subst(commit, buf.buf, buf.len, &buf); buffer = strbuf_detach(&buf, &size); *sizep = size; } return buffer;}
开发者ID:Jinyan,项目名称:git,代码行数:21,
示例29: sq_quote_buf/* Help to copy the thing properly quoted for the shell safety. * any single quote is replaced with '/'', any exclamation point * is replaced with '/!', and the whole thing is enclosed in a * single quote pair. * * E.g. * original sq_quote result * name ==> name ==> 'name' * a b ==> a b ==> 'a b' * a'b ==> a'/''b ==> 'a'/''b' * a!b ==> a'/!'b ==> 'a'/!'b' */void sq_quote_buf(struct strbuf *dst, const char *src){ char *to_free = NULL; if (dst->buf == src) to_free = strbuf_detach(dst, NULL); strbuf_addch(dst, '/''); while (*src) { size_t len = strcspn(src, "'!"); strbuf_add(dst, src, len); src += len; while (need_bs_quote(*src)) { strbuf_addstr(dst, "'//"); strbuf_addch(dst, *src++); strbuf_addch(dst, '/''); } } strbuf_addch(dst, '/''); free(to_free);}
开发者ID:Noffica,项目名称:git,代码行数:33,
示例30: exec_programstatic char *get_git_prefix(const char *wd, int *out_status){ char *eol; int status; struct strbuf output = STRBUF_INIT; status = exec_program(wd, &output, NULL, WAITMODE, "git", "rev-parse", "--show-prefix", NULL); if (out_status) *out_status = status; if (status) { strbuf_release(&output); return NULL; } eol = strchr(output.buf, '/n'); if (eol) *eol = 0; return strbuf_detach(&output, NULL);}
开发者ID:jeffreywugz,项目名称:Git-Cheetah,代码行数:21,
注:本文中的strbuf_detach函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ strbuf_free函数代码示例 C++ strbuf_close函数代码示例 |