branch 314 branch.c static char *find_linked_symref(const char *symref, const char *branch, branch 342 branch.c if (strcmp(sb.buf, branch)) branch 392 branch.c void die_if_checked_out(const char *branch) branch 396 branch.c existing = find_shared_symref("HEAD", branch); branch 398 branch.c skip_prefix(branch, "refs/heads/", &branch); branch 399 branch.c die(_("'%s' is already checked out at '%s'"), branch, existing); branch 60 branch.h extern void die_if_checked_out(const char *branch); branch 125 builtin/branch.c struct branch *branch = branch_get(name); branch 126 builtin/branch.c const char *upstream = branch_get_upstream(branch, NULL); branch 428 builtin/branch.c struct branch *branch = branch_get(branch_name); branch 434 builtin/branch.c if (stat_tracking_info(branch, &ours, &theirs, &upstream) < 0) { branch 581 builtin/branch.c state.branch); branch 584 builtin/branch.c state.branch); branch 597 builtin/branch.c free(state.branch); branch 959 builtin/branch.c struct branch *branch = branch_get(argv[0]); branch 964 builtin/branch.c if (!branch) { branch 972 builtin/branch.c if (!ref_exists(branch->refname)) branch 973 builtin/branch.c die(_("branch '%s' does not exist"), branch->name); branch 979 builtin/branch.c create_branch(head, branch->name, new_upstream, 0, 0, 0, quiet, BRANCH_TRACK_OVERRIDE); branch 981 builtin/branch.c struct branch *branch = branch_get(argv[0]); branch 987 builtin/branch.c if (!branch) { branch 994 builtin/branch.c if (!branch_has_merge_config(branch)) branch 995 builtin/branch.c die(_("Branch '%s' has no upstream information"), branch->name); branch 997 builtin/branch.c strbuf_addf(&buf, "branch.%s.remote", branch->name); branch 1000 builtin/branch.c strbuf_addf(&buf, "branch.%s.merge", branch->name); branch 1004 builtin/branch.c struct branch *branch = branch_get(argv[0]); branch 1011 builtin/branch.c if (!branch) branch 1020 builtin/branch.c strbuf_addf(&buf, "refs/remotes/%s", branch->name); branch 1024 builtin/branch.c branch_existed = ref_exists(branch->refname); branch 1035 builtin/branch.c fprintf(stderr, _("\nIf you wanted to make '%s' track '%s', do this:\n\n"), head, branch->name); branch 1036 builtin/branch.c fprintf(stderr, _(" git branch -d %s\n"), branch->name); branch 1037 builtin/branch.c fprintf(stderr, _(" git branch --set-upstream-to %s\n"), branch->name); branch 452 builtin/checkout.c static void setup_branch_path(struct branch_info *branch) branch 456 builtin/checkout.c strbuf_branchname(&buf, branch->name); branch 457 builtin/checkout.c if (strcmp(buf.buf, branch->name)) branch 458 builtin/checkout.c branch->name = xstrdup(buf.buf); branch 460 builtin/checkout.c branch->path = strbuf_detach(&buf, NULL); branch 597 builtin/checkout.c struct branch *branch = branch_get(new->name); branch 599 builtin/checkout.c if (!format_tracking_info(branch, &sb)) branch 492 builtin/clone.c static struct ref *find_remote_branch(const struct ref *refs, const char *branch) branch 497 builtin/clone.c strbuf_addstr(&head, branch); branch 505 builtin/clone.c strbuf_addstr(&head, branch); branch 147 builtin/fetch.c struct branch *branch, branch 152 builtin/fetch.c for (i = 0; i < branch->merge_nr; i++) { branch 157 builtin/fetch.c if (branch_merge_matches(branch, i, rm->name)) { branch 176 builtin/fetch.c refspec.src = branch->merge[i]->src; branch 350 builtin/fetch.c struct branch *branch = branch_get(NULL); branch 351 builtin/fetch.c int has_merge = branch_has_merge_config(branch); branch 355 builtin/fetch.c (has_merge && !strcmp(branch->remote_name, remote->name)))) { branch 373 builtin/fetch.c !strcmp(branch->remote_name, remote->name)) branch 374 builtin/fetch.c add_merge_config(&ref_map, remote_refs, branch, &tail); branch 453 builtin/fetch.c struct branch *current_branch = branch_get(NULL); branch 824 builtin/fetch.c struct branch *current_branch = branch_get(NULL); branch 39 builtin/fmt-merge-msg.c struct string_list branch, tag, r_branch, generic; branch 50 builtin/fmt-merge-msg.c data->branch.strdup_strings = 1; branch 163 builtin/fmt-merge-msg.c string_list_append(&src_data->branch, origin); branch 339 builtin/fmt-merge-msg.c struct object *branch; branch 348 builtin/fmt-merge-msg.c branch = deref_tag(parse_object(sha1), sha1_to_hex(sha1), 40); branch 349 builtin/fmt-merge-msg.c if (!branch || branch->type != OBJ_COMMIT) branch 353 builtin/fmt-merge-msg.c add_pending_object(rev, branch, name); branch 402 builtin/fmt-merge-msg.c clear_commit_marks((struct commit *)branch, flags); branch 434 builtin/fmt-merge-msg.c if (src_data->branch.nr) { branch 437 builtin/fmt-merge-msg.c print_joined("branch ", "branches ", &src_data->branch, branch 903 builtin/log.c char *full_ref, *branch = NULL; branch 920 builtin/log.c branch = xstrdup(v); branch 922 builtin/log.c return branch; branch 1633 builtin/log.c struct branch *current_branch; branch 10 builtin/merge-recursive.c static const char *better_branch_name(const char *branch) branch 15 builtin/merge-recursive.c if (strlen(branch) != 40) branch 16 builtin/merge-recursive.c return branch; branch 17 builtin/merge-recursive.c sprintf(githead_env, "GITHEAD_%s", branch); branch 19 builtin/merge-recursive.c return name ? name : branch; branch 61 builtin/merge.c static const char *branch; branch 537 builtin/merge.c die(_("Bad branch.%s.mergeoptions string: %s"), branch, branch 552 builtin/merge.c if (branch && starts_with(k, "branch.") && branch 553 builtin/merge.c starts_with(k + 7, branch) && branch 554 builtin/merge.c !strcmp(k + 7 + strlen(branch), ".mergeoptions")) { branch 930 builtin/merge.c struct branch *branch = branch_get(NULL); branch 934 builtin/merge.c if (!branch) branch 936 builtin/merge.c if (!branch->remote_name) branch 938 builtin/merge.c if (!branch->merge_nr) branch 941 builtin/merge.c args = xcalloc(branch->merge_nr + 1, sizeof(char *)); branch 942 builtin/merge.c for (i = 0; i < branch->merge_nr; i++) { branch 943 builtin/merge.c if (!branch->merge[i]->dst) branch 945 builtin/merge.c branch->merge[i]->src, branch->remote_name); branch 946 builtin/merge.c args[i] = branch->merge[i]->dst; branch 1183 builtin/merge.c branch = branch_to_free = resolve_refdup("HEAD", 0, head_sha1, &flag); branch 1184 builtin/merge.c if (branch && starts_with(branch, "refs/heads/")) branch 1185 builtin/merge.c branch += 11; branch 1186 builtin/merge.c if (!branch || is_null_sha1(head_sha1)) branch 280 builtin/pull.c struct branch *curr_branch = branch_get("HEAD"); branch 431 builtin/pull.c struct branch *curr_branch = branch_get("HEAD"); branch 623 builtin/pull.c struct branch *curr_branch; branch 689 builtin/pull.c struct branch *curr_branch; branch 63 builtin/push.c struct branch *branch = branch_get(matched->name + 11); branch 64 builtin/push.c if (branch->merge_nr == 1 && branch->merge[0]->src) { branch 67 builtin/push.c ref, branch->merge[0]->src); branch 121 builtin/push.c static NORETURN int die_push_simple(struct branch *branch, struct remote *remote) { branch 131 builtin/push.c const char *short_upstream = branch->merge[0]->src; branch 154 builtin/push.c remote->name, branch->name, advice_maybe); branch 164 builtin/push.c static void setup_push_upstream(struct remote *remote, struct branch *branch, branch 169 builtin/push.c if (!branch) branch 171 builtin/push.c if (!branch->merge_nr || !branch->merge || !branch->remote_name) branch 176 builtin/push.c branch->name, branch 178 builtin/push.c branch->name); branch 179 builtin/push.c if (branch->merge_nr != 1) branch 181 builtin/push.c "refusing to push."), branch->name); branch 186 builtin/push.c remote->name, branch->name); branch 190 builtin/push.c if (strcmp(branch->refname, branch->merge[0]->src)) branch 191 builtin/push.c die_push_simple(branch, remote); branch 194 builtin/push.c strbuf_addf(&refspec, "%s:%s", branch->name, branch->merge[0]->src); branch 198 builtin/push.c static void setup_push_current(struct remote *remote, struct branch *branch) branch 200 builtin/push.c if (!branch) branch 202 builtin/push.c add_refspec(branch->name); branch 244 builtin/push.c struct branch *branch = branch_get(NULL); branch 259 builtin/push.c setup_push_current(remote, branch); branch 261 builtin/push.c setup_push_upstream(remote, branch, triangular, 1); branch 265 builtin/push.c setup_push_upstream(remote, branch, triangular, 0); branch 269 builtin/push.c setup_push_current(remote, branch); branch 314 builtin/worktree.c const char *path, *branch; branch 333 builtin/worktree.c branch = ac < 2 ? "HEAD" : av[1]; branch 353 builtin/worktree.c argv_array_push(&cp.args, branch); branch 356 builtin/worktree.c branch = opts.new_branch; branch 359 builtin/worktree.c return add_worktree(path, branch, &opts); branch 2149 compat/regex/regcomp.c bin_tree_t *tree, *branch = NULL; branch 2160 compat/regex/regcomp.c branch = parse_branch (regexp, preg, token, syntax, nest, err); branch 2161 compat/regex/regcomp.c if (BE (*err != REG_NOERROR && branch == NULL, 0)) branch 2165 compat/regex/regcomp.c branch = NULL; branch 2166 compat/regex/regcomp.c tree = create_tree (dfa, tree, branch, OP_ALT); branch 246 fast-import.c struct branch *table_next_branch; branch 247 fast-import.c struct branch *active_next_branch; branch 349 fast-import.c static struct branch **branch_table; branch 350 fast-import.c static struct branch *active_branches; branch 378 fast-import.c static void parse_ls(const char *p, struct branch *b); branch 380 fast-import.c static void write_branch_report(FILE *rpt, struct branch *b) branch 412 fast-import.c struct branch *b; branch 713 fast-import.c static struct branch *lookup_branch(const char *name) branch 716 fast-import.c struct branch *b; branch 724 fast-import.c static struct branch *new_branch(const char *name) branch 727 fast-import.c struct branch *b = lookup_branch(name); branch 734 fast-import.c b = pool_calloc(1, sizeof(struct branch)); branch 966 fast-import.c struct branch *b; branch 1692 fast-import.c static int update_branch(struct branch *b) branch 1739 fast-import.c struct branch *b; branch 2096 fast-import.c struct branch *e, *l = NULL, *p = NULL; branch 2123 fast-import.c static void load_branch(struct branch *b) branch 2296 fast-import.c static void file_change_m(const char *p, struct branch *b) branch 2395 fast-import.c static void file_change_d(const char *p, struct branch *b) branch 2409 fast-import.c static void file_change_cr(const char *s, struct branch *b, int rename) branch 2461 fast-import.c static void note_change_n(const char *p, struct branch *b, unsigned char *old_fanout) branch 2465 fast-import.c struct branch *s; branch 2559 fast-import.c static void file_change_deleteall(struct branch *b) branch 2568 fast-import.c static void parse_from_commit(struct branch *b, char *buf, unsigned long size) branch 2579 fast-import.c static void parse_from_existing(struct branch *b) branch 2595 fast-import.c static int parse_from(struct branch *b) branch 2598 fast-import.c struct branch *s; branch 2650 fast-import.c struct branch *s; branch 2687 fast-import.c struct branch *b; branch 2787 fast-import.c struct branch *s; branch 2864 fast-import.c struct branch *b; branch 3076 fast-import.c static void parse_ls(const char *p, struct branch *b) branch 3403 fast-import.c branch_table = xcalloc(branch_table_sz, sizeof(struct branch*)); branch 436 help.c char *branch = strrchr(refname, '/') + 1; branch 441 help.c !strcmp(branch, cb->base_ref)) branch 1594 http-push.c struct commit *branch = lookup_commit_or_die(remote->old_sha1, remote->name); branch 1596 http-push.c return in_merge_bases(branch, head); branch 610 merge-recursive.c static char *unique_path(struct merge_options *o, const char *path, const char *branch) branch 617 merge-recursive.c add_flattened_path(&newpath, branch); branch 624 ref-filter.c struct branch *branch = NULL; branch 641 ref-filter.c branch = branch_get(branch_name); branch 643 ref-filter.c refname = branch_get_upstream(branch, NULL); branch 651 ref-filter.c branch = branch_get(branch_name); branch 653 ref-filter.c refname = branch_get_push(branch, NULL); branch 705 ref-filter.c if (stat_tracking_info(branch, &num_ours, branch 726 ref-filter.c assert(branch); branch 728 ref-filter.c if (stat_tracking_info(branch, &num_ours, branch 149 reflog-walk.c char *branch, *at = strchr(name, '@'); branch 156 reflog-walk.c branch = xstrdup(name); branch 159 reflog-walk.c branch[at - name] = '\0'; branch 171 reflog-walk.c item = string_list_lookup(&info->complete_reflogs, branch); branch 175 reflog-walk.c if (*branch == '\0') { branch 177 reflog-walk.c free(branch); branch 178 reflog-walk.c branch = resolve_refdup("HEAD", 0, sha1, NULL); branch 179 reflog-walk.c if (!branch) branch 183 reflog-walk.c reflogs = read_complete_reflog(branch); branch 187 reflog-walk.c if (dwim_log(branch, strlen(branch), sha1, &b) == 1) { branch 192 reflog-walk.c free(branch); branch 193 reflog-walk.c branch = b; branch 194 reflog-walk.c reflogs = read_complete_reflog(branch); branch 199 reflog-walk.c string_list_insert(&info->complete_reflogs, branch)->util branch 207 reflog-walk.c free(branch); branch 47 remote.c static struct branch **branches; branch 51 remote.c static struct branch *current_branch; branch 185 remote.c static void add_merge(struct branch *branch, const char *name) branch 187 remote.c ALLOC_GROW(branch->merge_name, branch->merge_nr + 1, branch 188 remote.c branch->merge_alloc); branch 189 remote.c branch->merge_name[branch->merge_nr++] = name; branch 192 remote.c static struct branch *make_branch(const char *name, int len) branch 194 remote.c struct branch *ret; branch 205 remote.c ret = xcalloc(1, sizeof(struct branch)); branch 301 remote.c struct strbuf branch = STRBUF_INIT; branch 333 remote.c strbuf_addf(&branch, "refs/heads/%s", frag); branch 335 remote.c strbuf_addstr(&branch, "refs/heads/master"); branch 337 remote.c strbuf_addf(&branch, ":refs/heads/%s", remote->name); branch 339 remote.c add_fetch_refspec(remote, strbuf_detach(&branch, NULL)); branch 344 remote.c strbuf_init(&branch, 0); branch 345 remote.c strbuf_addstr(&branch, "HEAD"); branch 347 remote.c strbuf_addf(&branch, ":refs/heads/%s", frag); branch 349 remote.c strbuf_addstr(&branch, ":refs/heads/master"); branch 350 remote.c add_push_refspec(remote, strbuf_detach(&branch, NULL)); branch 359 remote.c struct branch *branch; branch 365 remote.c branch = make_branch(name, subkey - name); branch 367 remote.c return git_config_string(&branch->remote_name, key, value); branch 369 remote.c return git_config_string(&branch->pushremote_name, key, value); branch 373 remote.c add_merge(branch, xstrdup(value)); branch 688 remote.c const char *remote_for_branch(struct branch *branch, int *explicit) branch 690 remote.c if (branch && branch->remote_name) { branch 693 remote.c return branch->remote_name; branch 700 remote.c const char *pushremote_for_branch(struct branch *branch, int *explicit) branch 702 remote.c if (branch && branch->pushremote_name) { branch 705 remote.c return branch->pushremote_name; branch 712 remote.c return remote_for_branch(branch, explicit); branch 716 remote.c const char *(*get_default)(struct branch *, int *)) branch 1644 remote.c static void set_merge(struct branch *ret) branch 1681 remote.c struct branch *branch_get(const char *name) branch 1683 remote.c struct branch *ret; branch 1694 remote.c int branch_has_merge_config(struct branch *branch) branch 1696 remote.c return branch && !!branch->merge; branch 1699 remote.c int branch_merge_matches(struct branch *branch, branch 1703 remote.c if (!branch || i < 0 || i >= branch->merge_nr) branch 1705 remote.c return refname_match(branch->merge[i]->src, refname); branch 1720 remote.c const char *branch_get_upstream(struct branch *branch, struct strbuf *err) branch 1722 remote.c if (!branch) branch 1725 remote.c if (!branch->merge || !branch->merge[0]) { branch 1731 remote.c if (!ref_exists(branch->refname)) branch 1733 remote.c branch->name); branch 1736 remote.c branch->name); branch 1739 remote.c if (!branch->merge[0]->dst) branch 1742 remote.c branch->merge[0]->src); branch 1744 remote.c return branch->merge[0]->dst; branch 1761 remote.c static const char *branch_get_push_1(struct branch *branch, struct strbuf *err) branch 1765 remote.c if (!branch) branch 1768 remote.c remote = remote_get(pushremote_for_branch(branch, NULL)); branch 1772 remote.c branch->name); branch 1779 remote.c branch->refname); branch 1783 remote.c remote->name, branch->name); branch 1791 remote.c return tracking_for_push_dest(remote, branch->refname, err); branch 1799 remote.c return tracking_for_push_dest(remote, branch->refname, err); branch 1802 remote.c return branch_get_upstream(branch, err); branch 1809 remote.c up = branch_get_upstream(branch, err); branch 1812 remote.c cur = tracking_for_push_dest(remote, branch->refname, err); branch 1825 remote.c const char *branch_get_push(struct branch *branch, struct strbuf *err) branch 1827 remote.c if (!branch->push_tracking_ref) branch 1828 remote.c branch->push_tracking_ref = branch_get_push_1(branch, err); branch 1829 remote.c return branch->push_tracking_ref; branch 2033 remote.c int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs, branch 2044 remote.c base = branch_get_upstream(branch, NULL); branch 2057 remote.c if (read_ref(branch->refname, sha1)) branch 2108 remote.c int format_tracking_info(struct branch *branch, struct strbuf *sb) branch 2115 remote.c if (stat_tracking_info(branch, &ours, &theirs, &full_base) < 0) { branch 216 remote.h struct branch *branch_get(const char *name); branch 217 remote.h const char *remote_for_branch(struct branch *branch, int *explicit); branch 218 remote.h const char *pushremote_for_branch(struct branch *branch, int *explicit); branch 220 remote.h int branch_has_merge_config(struct branch *branch); branch 221 remote.h int branch_merge_matches(struct branch *, int n, const char *); branch 232 remote.h const char *branch_get_upstream(struct branch *branch, struct strbuf *err); branch 240 remote.h const char *branch_get_push(struct branch *branch, struct strbuf *err); branch 252 remote.h int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs, branch 254 remote.h int format_tracking_info(struct branch *branch, struct strbuf *sb); branch 1075 sha1_name.c const char *(*get_data)(struct branch *, branch 1079 sha1_name.c struct branch *branch; branch 1092 sha1_name.c branch = branch_get(name_str); branch 1095 sha1_name.c branch = branch_get(NULL); branch 1097 sha1_name.c value = get_data(branch, &err); branch 130 wt-status.c s->branch = resolve_refdup("HEAD", 0, sha1, NULL); branch 901 wt-status.c struct branch *branch; branch 905 wt-status.c assert(s->branch && !s->is_initial); branch 906 wt-status.c if (!skip_prefix(s->branch, "refs/heads/", &branch_name)) branch 908 wt-status.c branch = branch_get(branch_name); branch 909 wt-status.c if (!format_tracking_info(branch, &sb)) branch 1009 wt-status.c !s->branch || strcmp(s->branch, "HEAD")) branch 1146 wt-status.c if (state->branch) branch 1149 wt-status.c state->branch, branch 1179 wt-status.c if (state->branch) branch 1182 wt-status.c state->branch, branch 1191 wt-status.c if (state->branch) branch 1194 wt-status.c state->branch, branch 1251 wt-status.c if (state->branch) branch 1254 wt-status.c state->branch); branch 1381 wt-status.c state->branch = read_and_strip_branch("rebase-apply/head-name"); branch 1389 wt-status.c state->branch = read_and_strip_branch("rebase-merge/head-name"); branch 1398 wt-status.c state->branch = read_and_strip_branch("BISECT_START"); branch 1436 wt-status.c s->branch && !strcmp(s->branch, "HEAD")); branch 1438 wt-status.c if (s->branch) { branch 1440 wt-status.c const char *branch_name = s->branch; branch 1469 wt-status.c free(state.branch); branch 1626 wt-status.c struct branch *branch; branch 1638 wt-status.c if (!s->branch) branch 1640 wt-status.c branch_name = s->branch; branch 1645 wt-status.c if (!strcmp(s->branch, "HEAD")) { branch 1653 wt-status.c branch = branch_get(branch_name); branch 1657 wt-status.c if (stat_tracking_info(branch, &num_ours, &num_theirs, &base) < 0) { branch 46 wt-status.h char *branch; branch 89 wt-status.h char *branch;