@@ -343,7 +343,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
343
343
struct object_id oid ;
344
344
struct tree * tree ;
345
345
int i , full_tree = 0 ;
346
- int chomp_prefix = prefix && * prefix ;
346
+ int full_name = ! prefix || ! * prefix ;
347
347
read_tree_fn_t fn = NULL ;
348
348
enum ls_tree_cmdmode cmdmode = MODE_DEFAULT ;
349
349
int null_termination = 0 ;
@@ -365,8 +365,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
365
365
MODE_NAME_STATUS ),
366
366
OPT_CMDMODE (0 , "object-only" , & cmdmode , N_ ("list only objects" ),
367
367
MODE_OBJECT_ONLY ),
368
- OPT_SET_INT (0 , "full-name" , & chomp_prefix ,
369
- N_ ("use full path names" ), 0 ),
368
+ OPT_BOOL (0 , "full-name" , & full_name , N_ ("use full path names" )),
370
369
OPT_BOOL (0 , "full-tree" , & full_tree ,
371
370
N_ ("list entire tree; not just current directory "
372
371
"(implies --full-name)" )),
@@ -387,7 +386,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
387
386
388
387
if (full_tree )
389
388
prefix = NULL ;
390
- options .prefix = chomp_prefix ? prefix : NULL ;
389
+ options .prefix = full_name ? NULL : prefix ;
391
390
392
391
/*
393
392
* We wanted to detect conflicts between --name-only and
0 commit comments