summaryrefslogtreecommitdiff
path: root/branch.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-06-25 11:24:20 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-06-25 11:24:20 -0700
commit9b3dacc95fc6259b116207b4ac345ffb9e86ea3b (patch)
tree6cc1491427743772be2c426efe679fd8b7d7a828 /branch.c
parentMerge branch 'jk/no-more-asciidoc7' (diff)
parentRemove i18n legos in notifying new branch tracking setup (diff)
downloadtgif-9b3dacc95fc6259b116207b4ac345ffb9e86ea3b.tar.xz
Merge branch 'nd/i18n-branch-lego'
Restructure the way message strings are created, in preparation for marking them for i18n. * nd/i18n-branch-lego: Remove i18n legos in notifying new branch tracking setup
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/branch.c b/branch.c
index eccdaf9392..2bef1e7e71 100644
--- a/branch.c
+++ b/branch.c
@@ -74,25 +74,33 @@ void install_branch_config(int flag, const char *local, const char *origin, cons
strbuf_addf(&key, "branch.%s.rebase", local);
git_config_set(key.buf, "true");
}
+ strbuf_release(&key);
if (flag & BRANCH_CONFIG_VERBOSE) {
- strbuf_reset(&key);
-
- strbuf_addstr(&key, origin ? "remote" : "local");
-
- /* Are we tracking a proper "branch"? */
- if (remote_is_branch) {
- strbuf_addf(&key, " branch %s", shortname);
- if (origin)
- strbuf_addf(&key, " from %s", origin);
- }
+ if (remote_is_branch && origin)
+ printf(rebasing ?
+ "Branch %s set up to track remote branch %s from %s by rebasing.\n" :
+ "Branch %s set up to track remote branch %s from %s.\n",
+ local, shortname, origin);
+ else if (remote_is_branch && !origin)
+ printf(rebasing ?
+ "Branch %s set up to track local branch %s by rebasing.\n" :
+ "Branch %s set up to track local branch %s.\n",
+ local, shortname);
+ else if (!remote_is_branch && origin)
+ printf(rebasing ?
+ "Branch %s set up to track remote ref %s by rebasing.\n" :
+ "Branch %s set up to track remote ref %s.\n",
+ local, remote);
+ else if (!remote_is_branch && !origin)
+ printf(rebasing ?
+ "Branch %s set up to track local ref %s by rebasing.\n" :
+ "Branch %s set up to track local ref %s.\n",
+ local, remote);
else
- strbuf_addf(&key, " ref %s", remote);
- printf("Branch %s set up to track %s%s.\n",
- local, key.buf,
- rebasing ? " by rebasing" : "");
+ die("BUG: impossible combination of %d and %p",
+ remote_is_branch, origin);
}
- strbuf_release(&key);
}
/*