summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-12-06 23:09:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-06 23:09:22 (GMT)
commit391fb22ac760042fd1cffe451f4ec9a4eb57e39e (patch)
treea933c90fefc73a2e6625ceec79043330b870c128 /builtin/fetch.c
parent92b52e1bd64b048beba44abae8a72b7ebebd9529 (diff)
parent2059e79c0dac1e1e4e55733618dc6ca9d00b8aa4 (diff)
downloadgit-391fb22ac760042fd1cffe451f4ec9a4eb57e39e.zip
git-391fb22ac760042fd1cffe451f4ec9a4eb57e39e.tar.gz
git-391fb22ac760042fd1cffe451f4ec9a4eb57e39e.tar.bz2
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.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 46ce7c2..f8765b3 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;