@@ -40,7 +40,7 @@ struct index_options {
4040};
4141
4242/* Forward declarations for helpers */
43- static void parse_opts (const char * * repo_path , struct index_options * options , struct args_info * args );
43+ static void parse_opts (const char * * repo_path , struct index_options * opts , struct args_info * args );
4444int print_matched_cb (const char * path , const char * matched_pathspec , void * payload );
4545
4646int lg2_add (git_repository * repo , int argc , char * * argv )
@@ -86,13 +86,13 @@ int lg2_add(git_repository *repo, int argc, char **argv)
8686 */
8787int print_matched_cb (const char * path , const char * matched_pathspec , void * payload )
8888{
89- struct index_options options = * (struct index_options * )(payload );
89+ struct index_options * opts = (struct index_options * )(payload );
9090 int ret ;
9191 unsigned status ;
9292 (void )matched_pathspec ;
9393
9494 /* Get the file status */
95- if (git_status_file (& status , options . repo , path ) < 0 )
95+ if (git_status_file (& status , opts -> repo , path ) < 0 )
9696 return -1 ;
9797
9898 if ((status & GIT_STATUS_WT_MODIFIED ) || (status & GIT_STATUS_WT_NEW )) {
@@ -102,7 +102,7 @@ int print_matched_cb(const char *path, const char *matched_pathspec, void *paylo
102102 ret = 1 ;
103103 }
104104
105- if (options . dry_run )
105+ if (opts -> dry_run )
106106 ret = 1 ;
107107
108108 return ret ;
@@ -132,7 +132,7 @@ void print_usage(void)
132132 exit (1 );
133133}
134134
135- static void parse_opts (const char * * repo_path , struct index_options * options , struct args_info * args )
135+ static void parse_opts (const char * * repo_path , struct index_options * opts , struct args_info * args )
136136{
137137 if (args -> argc <= 1 )
138138 print_usage ();
@@ -142,20 +142,20 @@ static void parse_opts(const char **repo_path, struct index_options *options, st
142142
143143 if (curr [0 ] != '-' ) {
144144 if (!strcmp ("add" , curr )) {
145- options -> mode = INDEX_ADD ;
145+ opts -> mode = INDEX_ADD ;
146146 continue ;
147- } else if (options -> mode == INDEX_NONE ) {
147+ } else if (opts -> mode == INDEX_NONE ) {
148148 fprintf (stderr , "missing command: %s" , curr );
149149 print_usage ();
150150 break ;
151151 } else {
152152 /* We might be looking at a filename */
153153 break ;
154154 }
155- } else if (match_bool_arg (& options -> verbose , args , "--verbose" ) ||
156- match_bool_arg (& options -> dry_run , args , "--dry-run" ) ||
155+ } else if (match_bool_arg (& opts -> verbose , args , "--verbose" ) ||
156+ match_bool_arg (& opts -> dry_run , args , "--dry-run" ) ||
157157 match_str_arg (repo_path , args , "--git-dir" ) ||
158- (options -> mode == INDEX_ADD && match_bool_arg (& options -> add_update , args , "--update" ))) {
158+ (opts -> mode == INDEX_ADD && match_bool_arg (& opts -> add_update , args , "--update" ))) {
159159 continue ;
160160 } else if (match_bool_arg (NULL , args , "--help" )) {
161161 print_usage ();
0 commit comments