aboutsummaryrefslogtreecommitdiffstats
path: root/ref-filter.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-03-03 17:12:22 +0100
committerJunio C Hamano <gitster@pobox.com>2020-03-03 14:56:05 -0800
commitaf8ccd8ade1e2dd1bf332067b98dd4459e29c1d3 (patch)
tree480dc5d3ae79acb6b50b826fb3b3c6ab22ffa3d3 /ref-filter.c
parent2f268890c2cd2f115424936bbee27f8269080e5e (diff)
downloadgit-af8ccd8ade1e2dd1bf332067b98dd4459e29c1d3.tar.gz
remote: drop "explicit" parameter from remote_ref_for_branch()
Commit 9700fae5ee (for-each-ref: let upstream/push report the remote ref name, 2017-11-07) added a remote_ref_for_branch() helper, which is modeled after remote_for_branch(). This includes providing an "explicit" out-parameter that tells the caller whether the remote was configured by the user, or whether we picked a default name like "origin". But unlike remote names, there is no default name when the user didn't configure one. The only way the "explicit" parameter is used by the caller is to use the value returned from the helper when it is set, and use an empty string otherwise, ignoring the returned value from the helper. Let's drop the "explicit" out-parameter, and return NULL when the returned value from the helper should be ignored, to simplify the function interface. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Damien Robert <damien.olivier.robert+git@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 6867e33648..9837700732 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");
}