summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-27 13:02:57 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-27 13:02:57 -0800
commit60b188a9844cdcf865174c685a38acc053a9d43b (patch)
treeb2ad8b5b4b20785ea137fa0ec5a11cb0b8517d8c /builtin-checkout.c
parent5a4d707a6d914fcea302e299fc18892d9e42c767 (diff)
parent572fc81d21b26d856dd3c2cc366b7452a4ed16e4 (diff)
downloadgit-60b188a9844cdcf865174c685a38acc053a9d43b.tar.gz
Merge branch 'js/branch-track'
* js/branch-track: doc: documentation update for the branch track changes branch: optionally setup branch.*.merge from upstream local branches Conflicts: Documentation/config.txt Documentation/git-branch.txt Documentation/git-checkout.txt builtin-branch.c cache.h t/t7201-co.sh
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index d5f093094c..4a4bb8b77d 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -186,7 +186,7 @@ struct checkout_opts {
char *new_branch;
int new_branch_log;
- int track;
+ enum branch_track track;
};
struct branch_info {
@@ -480,13 +480,8 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
return post_checkout_hook(old.commit, new->commit, 1);
}
-static int branch_track = 0;
-
static int git_checkout_config(const char *var, const char *value)
{
- if (!strcmp(var, "branch.autosetupmerge"))
- branch_track = git_config_bool(var, value);
-
return git_default_config(var, value);
}
@@ -501,7 +496,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
OPT__QUIET(&opts.quiet),
OPT_STRING('b', NULL, &opts.new_branch, "new branch", "branch"),
OPT_BOOLEAN('l', NULL, &opts.new_branch_log, "log for new branch"),
- OPT_BOOLEAN( 0 , "track", &opts.track, "track"),
+ OPT_SET_INT( 0 , "track", &opts.track, "track",
+ BRANCH_TRACK_EXPLICIT),
OPT_BOOLEAN('f', NULL, &opts.force, "force"),
OPT_BOOLEAN('m', NULL, &opts.merge, "merge"),
OPT_END(),
@@ -512,7 +508,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
git_config(git_checkout_config);
- opts.track = branch_track;
+ opts.track = git_branch_track;
argc = parse_options(argc, argv, options, checkout_usage, 0);
if (argc) {
@@ -541,7 +537,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
argc--;
}
- if (!opts.new_branch && (opts.track != branch_track))
+ if (!opts.new_branch && (opts.track != git_branch_track))
die("git checkout: --track and --no-track require -b");
if (opts.force && opts.merge)