summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-03-11 17:58:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-11 17:58:16 (GMT)
commit5fa9169ced8f874910cf4cf289a650d65f52df22 (patch)
treecabde11cf046e13183cdf5d69746a3bb2bea5382
parentcdef998b4619cb9acfe2955fcbe9db0ea2f46d33 (diff)
parentaf8ccd8ade1e2dd1bf332067b98dd4459e29c1d3 (diff)
downloadgit-5fa9169ced8f874910cf4cf289a650d65f52df22.zip
git-5fa9169ced8f874910cf4cf289a650d65f52df22.tar.gz
git-5fa9169ced8f874910cf4cf289a650d65f52df22.tar.bz2
Merge branch 'dr/push-remote-ref-update'
Code clean-up. * dr/push-remote-ref-update: remote: drop "explicit" parameter from remote_ref_for_branch()
-rw-r--r--ref-filter.c6
-rw-r--r--remote.c11
-rw-r--r--remote.h3
3 files changed, 5 insertions, 15 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 79bb520..b1812cb 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1459,12 +1459,10 @@ static void fill_remote_ref_details(struct used_atom *atom, const char *refname,
remote_for_branch(branch, &explicit);
*s = xstrdup(explicit ? remote : "");
} else if (atom->u.remote_ref.option == RR_REMOTE_REF) {
- int explicit;
const char *merge;
- merge = remote_ref_for_branch(branch, atom->u.remote_ref.push,
- &explicit);
- *s = xstrdup(explicit ? merge : "");
+ merge = remote_ref_for_branch(branch, atom->u.remote_ref.push);
+ *s = xstrdup(merge ? merge : "");
} else
BUG("unhandled RR_* enum");
}
diff --git a/remote.c b/remote.c
index 593ce29..c43196e 100644
--- a/remote.c
+++ b/remote.c
@@ -516,14 +516,11 @@ const char *pushremote_for_branch(struct branch *branch, int *explicit)
return remote_for_branch(branch, explicit);
}
-const char *remote_ref_for_branch(struct branch *branch, int for_push,
- int *explicit)
+const char *remote_ref_for_branch(struct branch *branch, int for_push)
{
if (branch) {
if (!for_push) {
if (branch->merge_nr) {
- if (explicit)
- *explicit = 1;
return branch->merge_name[0];
}
} else {
@@ -534,15 +531,11 @@ const char *remote_ref_for_branch(struct branch *branch, int for_push,
if (remote && remote->push.nr &&
(dst = apply_refspecs(&remote->push,
branch->refname))) {
- if (explicit)
- *explicit = 1;
return dst;
}
}
}
- if (explicit)
- *explicit = 0;
- return "";
+ return NULL;
}
static struct remote *remote_get_1(const char *name,
diff --git a/remote.h b/remote.h
index b134cc2..11d8719 100644
--- a/remote.h
+++ b/remote.h
@@ -261,8 +261,7 @@ struct branch {
struct branch *branch_get(const char *name);
const char *remote_for_branch(struct branch *branch, int *explicit);
const char *pushremote_for_branch(struct branch *branch, int *explicit);
-const char *remote_ref_for_branch(struct branch *branch, int for_push,
- int *explicit);
+const char *remote_ref_for_branch(struct branch *branch, int for_push);
/* returns true if the given branch has merge configuration given. */
int branch_has_merge_config(struct branch *branch);