Skip to content

Commit edf4c0d

Browse files
committed
Merge branch 'jc/retire-cas-opt-name-constant' into maint-2.43
Code clean-up. * jc/retire-cas-opt-name-constant: remote.h: retire CAS_OPT_NAME
2 parents 2873a96 + a762af3 commit edf4c0d

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

builtin/push.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static int push_with_options(struct transport *transport, struct refspec *rs,
392392
if (!is_empty_cas(&cas)) {
393393
if (!transport->smart_options)
394394
die("underlying transport does not support --%s option",
395-
CAS_OPT_NAME);
395+
"force-with-lease");
396396
transport->smart_options->cas = &cas;
397397
}
398398

@@ -599,7 +599,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
599599
OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN),
600600
OPT_BIT( 0, "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN),
601601
OPT_BIT('f', "force", &flags, N_("force updates"), TRANSPORT_PUSH_FORCE),
602-
OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"),
602+
OPT_CALLBACK_F(0, "force-with-lease", &cas, N_("<refname>:<expect>"),
603603
N_("require old value of ref to be at this value"),
604604
PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP, parseopt_push_cas_option),
605605
OPT_BIT(0, TRANS_OPT_FORCE_IF_INCLUDES, &flags,

builtin/send-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
205205
OPT_BOOL(0, "stateless-rpc", &stateless_rpc, N_("use stateless RPC protocol")),
206206
OPT_BOOL(0, "stdin", &from_stdin, N_("read refs from stdin")),
207207
OPT_BOOL(0, "helper-status", &helper_status, N_("print status from remote helper")),
208-
OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"),
208+
OPT_CALLBACK_F(0, "force-with-lease", &cas, N_("<refname>:<expect>"),
209209
N_("require old value of ref to be at this value"),
210210
PARSE_OPT_OPTARG, parseopt_push_cas_option),
211211
OPT_BOOL(0, TRANS_OPT_FORCE_IF_INCLUDES, &force_if_includes,

remote.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,6 @@ struct ref *get_stale_heads(struct refspec *rs, struct ref *fetch_map);
400400
/*
401401
* Compare-and-swap
402402
*/
403-
#define CAS_OPT_NAME "force-with-lease"
404-
405403
struct push_cas_option {
406404
unsigned use_tracking_for_rest:1;
407405
unsigned use_force_if_includes:1;

0 commit comments

Comments
 (0)