diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-12-07 02:09:22 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-12-07 02:09:22 +0300 |
commit | 391fb22ac760042fd1cffe451f4ec9a4eb57e39e (patch) | |
tree | a933c90fefc73a2e6625ceec79043330b870c128 /builtin/fetch.c | |
parent | 92b52e1bd64b048beba44abae8a72b7ebebd9529 (diff) | |
parent | 2059e79c0dac1e1e4e55733618dc6ca9d00b8aa4 (diff) |
Merge branch 'rs/use-skip-prefix-more'
Code cleanup.
* rs/use-skip-prefix-more:
name-rev: use skip_prefix() instead of starts_with()
push: use skip_prefix() instead of starts_with()
shell: use skip_prefix() instead of starts_with()
fmt-merge-msg: use skip_prefix() instead of starts_with()
fetch: use skip_prefix() instead of starts_with()
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r-- | builtin/fetch.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index 46ce7c2710c..f8765b385b6 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -957,18 +957,12 @@ static int store_updated_refs(const char *raw_url, const char *remote_name, kind = ""; what = ""; } - else if (starts_with(rm->name, "refs/heads/")) { + else if (skip_prefix(rm->name, "refs/heads/", &what)) kind = "branch"; - what = rm->name + 11; - } - else if (starts_with(rm->name, "refs/tags/")) { + else if (skip_prefix(rm->name, "refs/tags/", &what)) kind = "tag"; - what = rm->name + 10; - } - else if (starts_with(rm->name, "refs/remotes/")) { + else if (skip_prefix(rm->name, "refs/remotes/", &what)) kind = "remote-tracking branch"; - what = rm->name + 13; - } else { kind = ""; what = rm->name; |