aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-02-27 21:58:31 -0800
committerJunio C Hamano <gitster@pobox.com>2011-02-27 21:58:31 -0800
commit8978166e531e0941811099d4117574ebbbcf35d8 (patch)
tree97c222b3705ea1980557ae1f96dda1d272625a83
parentfbfeeaf29480a3299fa6c3349b7a8c1b147c18c5 (diff)
parent53c403116a947c538132fc721f83196036f7a299 (diff)
downloadgit-8978166e531e0941811099d4117574ebbbcf35d8.tar.gz
git-8978166e531e0941811099d4117574ebbbcf35d8.tar.xz
Merge branch 'jh/push-default-upstream-configname'
* jh/push-default-upstream-configname: push.default: Rename 'tracking' to 'upstream'
-rw-r--r--Documentation/config.txt3
-rw-r--r--builtin/push.c10
-rw-r--r--cache.h2
-rw-r--r--config.c6
4 files changed, 12 insertions, 9 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index c5e183516..c995a1a47 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1591,7 +1591,8 @@ push.default::
* `matching` - push all matching branches.
All branches having the same name in both ends are considered to be
matching. This is the default.
-* `tracking` - push the current branch to its upstream branch.
+* `upstream` - push the current branch to its upstream branch.
+* `tracking` - deprecated synonym for `upstream`.
* `current` - push the current branch to a branch of the same name.
rebase.stat::
diff --git a/builtin/push.c b/builtin/push.c
index e655eb769..31da418cf 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -64,17 +64,17 @@ static void set_refspecs(const char **refs, int nr)
}
}
-static void setup_push_tracking(void)
+static void setup_push_upstream(void)
{
struct strbuf refspec = STRBUF_INIT;
struct branch *branch = branch_get(NULL);
if (!branch)
die("You are not currently on a branch.");
if (!branch->merge_nr || !branch->merge)
- die("The current branch %s is not tracking anything.",
+ die("The current branch %s has no upstream branch.",
branch->name);
if (branch->merge_nr != 1)
- die("The current branch %s is tracking multiple branches, "
+ die("The current branch %s has multiple upstream branches, "
"refusing to push.", branch->name);
strbuf_addf(&refspec, "%s:%s", branch->name, branch->merge[0]->src);
add_refspec(refspec.buf);
@@ -88,8 +88,8 @@ static void setup_default_push_refspecs(void)
add_refspec(":");
break;
- case PUSH_DEFAULT_TRACKING:
- setup_push_tracking();
+ case PUSH_DEFAULT_UPSTREAM:
+ setup_push_upstream();
break;
case PUSH_DEFAULT_CURRENT:
diff --git a/cache.h b/cache.h
index 79723aac7..08a902210 100644
--- a/cache.h
+++ b/cache.h
@@ -623,7 +623,7 @@ enum rebase_setup_type {
enum push_default_type {
PUSH_DEFAULT_NOTHING = 0,
PUSH_DEFAULT_MATCHING,
- PUSH_DEFAULT_TRACKING,
+ PUSH_DEFAULT_UPSTREAM,
PUSH_DEFAULT_CURRENT
};
diff --git a/config.c b/config.c
index d5bb8629a..31f778b5e 100644
--- a/config.c
+++ b/config.c
@@ -737,8 +737,10 @@ static int git_default_push_config(const char *var, const char *value)
push_default = PUSH_DEFAULT_NOTHING;
else if (!strcmp(value, "matching"))
push_default = PUSH_DEFAULT_MATCHING;
- else if (!strcmp(value, "tracking"))
- push_default = PUSH_DEFAULT_TRACKING;
+ else if (!strcmp(value, "upstream"))
+ push_default = PUSH_DEFAULT_UPSTREAM;
+ else if (!strcmp(value, "tracking")) /* deprecated */
+ push_default = PUSH_DEFAULT_UPSTREAM;
else if (!strcmp(value, "current"))
push_default = PUSH_DEFAULT_CURRENT;
else {