1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-23 12:36:09 +02:00
git/branch.h
Jay Soffian 9ed36cfa35 branch: optionally setup branch.*.merge from upstream local branches
"git branch" and "git checkout -b" now honor --track option even when
the upstream branch is local.  Previously --track was silently ignored
when forking from a local branch.  Also the command did not error out
when --track was explicitly asked for but the forked point specified
was not an existing branch (i.e. when there is no way to set up the
tracking configuration), but now it correctly does.

The configuration setting branch.autosetupmerge can now be set to
"always", which is equivalent to using --track from the command line.
Setting branch.autosetupmerge to "true" will retain the former behavior
of only setting up branch.*.merge for remote upstream branches.

Includes test cases for the new functionality.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-19 21:17:45 -08:00

25 lines
809 B
C

#ifndef BRANCH_H
#define BRANCH_H
/* Functions for acting on the information about branches. */
/*
* Creates a new branch, where head is the branch currently checked
* out, name is the new branch name, start_name is the name of the
* existing branch that the new branch should start from, force
* enables overwriting an existing (non-head) branch, reflog creates a
* reflog for the branch, and track causes the new branch to be
* configured to merge the remote branch that start_name is a tracking
* branch for (if any).
*/
void create_branch(const char *head, const char *name, const char *start_name,
int force, int reflog, enum branch_track track);
/*
* Remove information about the state of working on the current
* branch. (E.g., MERGE_HEAD)
*/
void remove_branch_state(void);
#endif