@@ -58,8 +58,6 @@ pub enum Subcommands {
58
58
/// Subcommands for interacting with commit-graphs
59
59
#[ clap( subcommand) ]
60
60
CommitGraph ( commitgraph:: Subcommands ) ,
61
- /// Subcommands for interacting with a worktree index, typically at .git/index
62
- Index ( index:: Platform ) ,
63
61
/// Subcommands for interacting with entire git repositories
64
62
Repository ( repo:: Platform ) ,
65
63
/// Subcommands that need no git repository to run.
@@ -79,6 +77,57 @@ pub mod free {
79
77
/// Subcommands for interacting with pack files and indices
80
78
#[ clap( subcommand) ]
81
79
Pack ( pack:: Subcommands ) ,
80
+ /// Subcommands for interacting with a worktree index, typically at .git/index
81
+ Index ( index:: Platform ) ,
82
+ }
83
+
84
+ pub mod index {
85
+ use std:: path:: PathBuf ;
86
+
87
+ #[ derive( Debug , clap:: Parser ) ]
88
+ pub struct Platform {
89
+ /// The object format to assume when reading files that don't inherently know about it, or when writing files.
90
+ #[ clap( long, default_value_t = git_repository:: hash:: Kind :: default ( ) , possible_values( & [ "SHA1" ] ) ) ]
91
+ pub object_hash : git_repository:: hash:: Kind ,
92
+
93
+ /// The path to the index file.
94
+ #[ clap( short = 'i' , long, default_value = ".git/index" ) ]
95
+ pub index_path : PathBuf ,
96
+
97
+ /// Subcommands
98
+ #[ clap( subcommand) ]
99
+ pub cmd : Subcommands ,
100
+ }
101
+
102
+ #[ derive( Debug , clap:: Subcommand ) ]
103
+ pub enum Subcommands {
104
+ /// Validate constraints and assumptions of an index along with its integrity.
105
+ Verify ,
106
+ /// Print all entries to standard output
107
+ Entries ,
108
+ /// Print information about the index structure
109
+ Info {
110
+ /// Do not extract specific extension information to gain only a superficial idea of the index's composition.
111
+ #[ clap( long) ]
112
+ no_details : bool ,
113
+ } ,
114
+ /// Checkout the index into a directory with exclusive write access, similar to what would happen during clone.
115
+ CheckoutExclusive {
116
+ /// The path to `.git` repository from which objects can be obtained to write the actual files referenced
117
+ /// in the index. Use this measure the impact on extracting objects on overall performance.
118
+ #[ clap( long, short = 'r' ) ]
119
+ repository : Option < PathBuf > ,
120
+ /// Ignore errors and keep checking out as many files as possible, and report all errors at the end of the operation.
121
+ #[ clap( long, short = 'k' ) ]
122
+ keep_going : bool ,
123
+ /// Enable to query the object database yet write only empty files. This is useful to measure the overhead of ODB query
124
+ /// compared to writing the bytes to disk.
125
+ #[ clap( long, short = 'e' , requires = "repository" ) ]
126
+ empty_files : bool ,
127
+ /// The directory into which to write all index entries.
128
+ directory : PathBuf ,
129
+ } ,
130
+ }
82
131
}
83
132
84
133
///
@@ -537,55 +586,6 @@ pub mod repo {
537
586
}
538
587
539
588
///
540
- pub mod index {
541
- use std:: path:: PathBuf ;
542
-
543
- #[ derive( Debug , clap:: Parser ) ]
544
- pub struct Platform {
545
- /// The object format to assume when reading files that don't inherently know about it, or when writing files.
546
- #[ clap( long, default_value_t = git_repository:: hash:: Kind :: default ( ) , possible_values( & [ "SHA1" ] ) ) ]
547
- pub object_hash : git_repository:: hash:: Kind ,
548
-
549
- /// The path to the index file.
550
- #[ clap( short = 'i' , long, default_value = ".git/index" ) ]
551
- pub index_path : PathBuf ,
552
-
553
- /// Subcommands
554
- #[ clap( subcommand) ]
555
- pub cmd : Subcommands ,
556
- }
557
-
558
- #[ derive( Debug , clap:: Subcommand ) ]
559
- pub enum Subcommands {
560
- /// Validate constraints and assumptions of an index along with its integrity.
561
- Verify ,
562
- /// Print all entries to standard output
563
- Entries ,
564
- /// Print information about the index structure
565
- Info {
566
- /// Do not extract specific extension information to gain only a superficial idea of the index's composition.
567
- #[ clap( long) ]
568
- no_details : bool ,
569
- } ,
570
- /// Checkout the index into a directory with exclusive write access, similar to what would happen during clone.
571
- CheckoutExclusive {
572
- /// The path to `.git` repository from which objects can be obtained to write the actual files referenced
573
- /// in the index. Use this measure the impact on extracting objects on overall performance.
574
- #[ clap( long, short = 'r' ) ]
575
- repository : Option < PathBuf > ,
576
- /// Ignore errors and keep checking out as many files as possible, and report all errors at the end of the operation.
577
- #[ clap( long, short = 'k' ) ]
578
- keep_going : bool ,
579
- /// Enable to query the object database yet write only empty files. This is useful to measure the overhead of ODB query
580
- /// compared to writing the bytes to disk.
581
- #[ clap( long, short = 'e' , requires = "repository" ) ]
582
- empty_files : bool ,
583
- /// The directory into which to write all index entries.
584
- directory : PathBuf ,
585
- } ,
586
- }
587
- }
588
-
589
589
///
590
590
pub mod commitgraph {
591
591
use std:: path:: PathBuf ;
0 commit comments