aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2025-03-18 18:50:27 -0400
committerJunio C Hamano <gitster@pobox.com>2025-03-21 01:45:16 -0700
commit459e54b5497b53f298fe9164112f9bcb33bedb8d (patch)
tree298147dd9214e0ab90606c3ebbc7b06c02ff2050 /builtin
parentrefspec: remove refspec_item_init_or_die() (diff)
downloadgit-459e54b5497b53f298fe9164112f9bcb33bedb8d.tar.gz
git-459e54b5497b53f298fe9164112f9bcb33bedb8d.zip
refspec: replace `refspec_item_init()` with fetch/push variants
For similar reasons as in the previous refactoring of `refspec_init()` into `refspec_init_fetch()` and `refspec_init_push()`, apply the same refactoring to `refspec_item_init()`. Signed-off-by: Taylor Blau <me@ttaylorr.com> Acked-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fetch.c2
-rw-r--r--builtin/pull.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 02af505469..9830c09011 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -586,7 +586,7 @@ static struct ref *get_ref_map(struct remote *remote,
struct refspec_item tag_refspec;
/* also fetch all tags */
- refspec_item_init(&tag_refspec, TAG_REFSPEC, 0);
+ refspec_item_init_push(&tag_refspec, TAG_REFSPEC);
get_fetch_map(remote_refs, &tag_refspec, &tail, 0);
refspec_item_clear(&tag_refspec);
} else if (tags == TAGS_DEFAULT && *autotags) {
diff --git a/builtin/pull.c b/builtin/pull.c
index a68a9955de..a1ebc6ad33 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -738,7 +738,7 @@ static const char *get_tracking_branch(const char *remote, const char *refspec)
const char *spec_src;
const char *merge_branch;
- if (!refspec_item_init(&spec, refspec, 1))
+ if (!refspec_item_init_fetch(&spec, refspec))
die(_("invalid refspec '%s'"), refspec);
spec_src = spec.src;
if (!*spec_src || !strcmp(spec_src, "HEAD"))