summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>2014-02-27 19:35:29 +0400
committerJunio C Hamano <gitster@pobox.com>2014-02-27 11:53:23 -0800
commitfb73d8a51270e80e13c36a070407e5042bfd079e (patch)
tree5886147e9002f6c7e1b4b60c2757d29358bf8afc
parent0a9136f32758a785fe552adc58bba5824f85e5b7 (diff)
downloadgit-mh/micro-projects.tar.gz
branch: change install_branch_config() to use skip_prefix()mh/micro-projects
Change install_branch_config() to use skip_prefix() for getting the short name of the remote branch. Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--branch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/branch.c b/branch.c
index 723a36bc54..9382e028c0 100644
--- a/branch.c
+++ b/branch.c
@@ -49,8 +49,8 @@ static int should_setup_rebase(const char *origin)
void install_branch_config(int flag, const char *local, const char *origin, const char *remote)
{
- const char *shortname = remote + 11;
- int remote_is_branch = starts_with(remote, "refs/heads/");
+ const char *shortname = skip_prefix(remote, "refs/heads/");
+ int remote_is_branch = shortname != NULL;
struct strbuf key = STRBUF_INIT;
int rebasing = should_setup_rebase(origin);