Skip to content

Commit 780b2c4

Browse files
committed
Merge branch 'jc/retire-cas-opt-name-constant' into seen
* jc/retire-cas-opt-name-constant: remote.h: retire CAS_OPT_NAME
2 parents 6b35fa6 + a762af3 commit 780b2c4

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
@@ -391,7 +391,7 @@ static int push_with_options(struct transport *transport, struct refspec *rs,
391391
if (!is_empty_cas(&cas)) {
392392
if (!transport->smart_options)
393393
die("underlying transport does not support --%s option",
394-
CAS_OPT_NAME);
394+
"force-with-lease");
395395
transport->smart_options->cas = &cas;
396396
}
397397

@@ -598,7 +598,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
598598
OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN),
599599
OPT_BIT( 0, "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN),
600600
OPT_BIT('f', "force", &flags, N_("force updates"), TRANSPORT_PUSH_FORCE),
601-
OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"),
601+
OPT_CALLBACK_F(0, "force-with-lease", &cas, N_("<refname>:<expect>"),
602602
N_("require old value of ref to be at this value"),
603603
PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP, parseopt_push_cas_option),
604604
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
@@ -200,7 +200,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
200200
OPT_BOOL(0, "stateless-rpc", &stateless_rpc, N_("use stateless RPC protocol")),
201201
OPT_BOOL(0, "stdin", &from_stdin, N_("read refs from stdin")),
202202
OPT_BOOL(0, "helper-status", &helper_status, N_("print status from remote helper")),
203-
OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"),
203+
OPT_CALLBACK_F(0, "force-with-lease", &cas, N_("<refname>:<expect>"),
204204
N_("require old value of ref to be at this value"),
205205
PARSE_OPT_OPTARG, parseopt_push_cas_option),
206206
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
@@ -401,8 +401,6 @@ struct ref *get_stale_heads(struct refspec *rs, struct ref *fetch_map);
401401
/*
402402
* Compare-and-swap
403403
*/
404-
#define CAS_OPT_NAME "force-with-lease"
405-
406404
struct push_cas_option {
407405
unsigned use_tracking_for_rest:1;
408406
unsigned use_force_if_includes:1;

0 commit comments

Comments
 (0)