diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-12-19 11:26:25 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-12-19 11:27:04 -0800 |
| commit | a762af3dfd9450bf1d6153faa620cb42efb7daa8 (patch) | |
| tree | 98080fa42e55f3d14fabc3fb4856d657e0e46bb3 /builtin/push.c | |
| parent | fb7d80edcae482f4fa5d4be0227dc3054734e5f3 (diff) | |
| download | git-a762af3dfd9450bf1d6153faa620cb42efb7daa8.tar.gz | |
remote.h: retire CAS_OPT_NAME
When the "--force-with-lease" option was introduced in 28f5d176
(remote.c: add command line option parser for "--force-with-lease",
2013-07-08), the design discussion revolved around the concept of
"compare-and-swap", and it can still be seen in the name used for
variables and helper functions. The end-user facing option name
ended up to be a bit different, so during the development iteration
of the feature, we used this C preprocessor macro to make it easier
to rename it later.
All of that happened more than 10 years ago, and the flexibility
afforded by the CAS_OPT_NAME macro outlived its usefulness. Inline
the constant string for the option name, like all other option names
in the code.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/push.c')
| -rw-r--r-- | builtin/push.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/push.c b/builtin/push.c index dbdf609daf..e740dd93e3 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -393,7 +393,7 @@ static int push_with_options(struct transport *transport, struct refspec *rs, if (!is_empty_cas(&cas)) { if (!transport->smart_options) die("underlying transport does not support --%s option", - CAS_OPT_NAME); + "force-with-lease"); transport->smart_options->cas = &cas; } @@ -604,7 +604,7 @@ int cmd_push(int argc, const char **argv, const char *prefix) OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN), OPT_BIT( 0, "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN), OPT_BIT('f', "force", &flags, N_("force updates"), TRANSPORT_PUSH_FORCE), - OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"), + OPT_CALLBACK_F(0, "force-with-lease", &cas, N_("<refname>:<expect>"), N_("require old value of ref to be at this value"), PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP, parseopt_push_cas_option), OPT_BIT(0, TRANS_OPT_FORCE_IF_INCLUDES, &flags, |
