|
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 |
|
@@ -785,6 +785,9 @@ int cmd_update_ref(int argc, |
785 | 785 | OPT_BOOL( 0 , "create-reflog", &create_reflog, N_("create a reflog")), |
786 | 786 | OPT_BIT('0', "batch-updates", &flags, N_("batch reference updates"), |
787 | 787 | REF_TRANSACTION_ALLOW_FAILURE), |
| 788 | + OPT_BIT(0, "initial", &flags, |
| 789 | + N_("assume the ref store is empty and skip checks"), |
| 790 | + REF_TRANSACTION_FLAG_INITIAL), |
788 | 791 | OPT_HIDDEN_BOOL(0, "batch-report-early", |
789 | 792 | &report_rejections_on_prepare, |
790 | 793 | N_("report batch-update rejections during prepare")), |
@@ -816,6 +819,8 @@ int cmd_update_ref(int argc, |
816 | 819 | return 0; |
817 | 820 | } else if (flags & REF_TRANSACTION_ALLOW_FAILURE) { |
818 | 821 | die("--batch-updates can only be used with --stdin"); |
| 822 | + } else if (flags & REF_TRANSACTION_FLAG_INITIAL) { |
| 823 | + die("--initial can only be used with --stdin"); |
819 | 824 | } else if (report_rejections_on_prepare) { |
820 | 825 | die("--batch-report-early can only be used with --stdin"); |
821 | 826 | } |
|
0 commit comments