diff options
author | Brandon Williams <bmwill@google.com> | 2018-05-17 00:57:54 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-17 23:19:42 +0200 |
commit | 895d3912582360a9f1ab805c75883f9fcf5f5c3c (patch) | |
tree | f2f4d6dfd7a3a08d72a4d04bbc5bfb9466308277 /builtin | |
parent | submodule--helper: convert push_check to use struct refspec (diff) | |
download | git-895d3912582360a9f1ab805c75883f9fcf5f5c3c.tar.xz git-895d3912582360a9f1ab805c75883f9fcf5f5c3c.zip |
pull: convert get_tracking_branch to use refspec_item_init
Convert 'get_tracking_branch()' to use 'refspec_item_init()' instead of
the old 'parse_fetch_refspec()' function.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/pull.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/pull.c b/builtin/pull.c index 5a79deae5d..09575fd23c 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -676,12 +676,12 @@ static const char *get_upstream_branch(const char *remote) */ static const char *get_tracking_branch(const char *remote, const char *refspec) { - struct refspec_item *spec; + struct refspec_item spec; const char *spec_src; const char *merge_branch; - spec = parse_fetch_refspec(1, &refspec); - spec_src = spec->src; + refspec_item_init(&spec, refspec, REFSPEC_FETCH); + spec_src = spec.src; if (!*spec_src || !strcmp(spec_src, "HEAD")) spec_src = "HEAD"; else if (skip_prefix(spec_src, "heads/", &spec_src)) @@ -701,7 +701,7 @@ static const char *get_tracking_branch(const char *remote, const char *refspec) } else merge_branch = NULL; - free_refspec(1, spec); + refspec_item_clear(&spec); return merge_branch; } |