|
15 | 15 | static const char * const git_update_ref_usage[] = { |
16 | 16 | N_("git update-ref [<options>] -d <refname> [<old-oid>]"), |
17 | 17 | N_("git update-ref [<options>] <refname> <new-oid> [<old-oid>]"), |
18 | | - N_("git update-ref [<options>] --stdin [-z] [--batch-updates]"), |
| 18 | + N_("git update-ref [<options>] --stdin [-z] [--initial] [--batch-updates]"), |
19 | 19 | NULL |
20 | 20 | }; |
21 | 21 |
|
@@ -842,6 +842,9 @@ int cmd_update_ref(int argc, |
842 | 842 | OPT_BOOL( 0 , "create-reflog", &create_reflog, N_("create a reflog")), |
843 | 843 | OPT_BIT('0', "batch-updates", &flags, N_("batch reference updates"), |
844 | 844 | REF_TRANSACTION_ALLOW_FAILURE), |
| 845 | + OPT_BIT(0, "initial", &flags, |
| 846 | + N_("assume the ref store is empty and skip checks"), |
| 847 | + REF_TRANSACTION_FLAG_INITIAL), |
845 | 848 | OPT_HIDDEN_BOOL(0, "batch-report-early", |
846 | 849 | &report_rejections_on_prepare, |
847 | 850 | N_("report batch-update rejections during prepare")), |
@@ -873,6 +876,8 @@ int cmd_update_ref(int argc, |
873 | 876 | return 0; |
874 | 877 | } else if (flags & REF_TRANSACTION_ALLOW_FAILURE) { |
875 | 878 | die("--batch-updates can only be used with --stdin"); |
| 879 | + } else if (flags & REF_TRANSACTION_FLAG_INITIAL) { |
| 880 | + die("--initial can only be used with --stdin"); |
876 | 881 | } else if (report_rejections_on_prepare) { |
877 | 882 | die("--batch-report-early can only be used with --stdin"); |
878 | 883 | } |
|
0 commit comments