@@ -65,10 +65,12 @@ def commit(ctx, source: str, executable: bool, max_days: int, scrub_pii: bool, i
6565
6666 # Commit messages are not collected in the default.
6767 is_collect_message = False
68+ is_collect_files = False
6869 try :
6970 res = client .request ("get" , "commits/collect/options" )
7071 res .raise_for_status ()
7172 is_collect_message = res .json ().get ("commitMessage" , False )
73+ is_collect_files = res .json ().get ("files" , False )
7274 except Exception as e :
7375 tracking_client .send_error_event (
7476 event_name = Tracking .ErrorEvent .INTERNAL_CLI_ERROR ,
@@ -79,7 +81,7 @@ def commit(ctx, source: str, executable: bool, max_days: int, scrub_pii: bool, i
7981
8082 cwd = os .path .abspath (source )
8183 try :
82- exec_jar (cwd , max_days , ctx .obj , is_collect_message )
84+ exec_jar (cwd , max_days , ctx .obj , is_collect_message , is_collect_files )
8385 except Exception as e :
8486 if os .getenv (REPORT_ERROR_KEY ):
8587 raise e
@@ -89,7 +91,7 @@ def commit(ctx, source: str, executable: bool, max_days: int, scrub_pii: bool, i
8991 "If not, please set a directory use by --source option.\n error: {}" .format (cwd , e ))
9092
9193
92- def exec_jar (source : str , max_days : int , app : Application , is_collect_message : bool ):
94+ def exec_jar (source : str , max_days : int , app : Application , is_collect_message : bool , is_collect_files : bool ):
9395 java = get_java_command ()
9496
9597 if not java :
@@ -120,6 +122,8 @@ def exec_jar(source: str, max_days: int, app: Application, is_collect_message: b
120122 command .append ("-skip-cert-verification" )
121123 if is_collect_message :
122124 command .append ("-commit-message" )
125+ if is_collect_files :
126+ command .append ("-files" )
123127 if os .getenv (COMMIT_TIMEOUT ):
124128 command .append ("-enable-timeout" )
125129 command .append (cygpath (source ))
0 commit comments