@@ -895,29 +895,26 @@ Return the list of files that haven't been handled."
895895 (unless (git-empty-db-p)
896896 (setq head (git-rev-parse " HEAD" )
897897 head-tree (git-rev-parse " HEAD^{tree}" )))
898- (if files
899- (progn
900- (message " Running git commit... " )
901- (when
902- (and
903- (git-read-tree head-tree index-file)
904- (git-update-index nil files ) ; update both the default index
905- (git-update-index index-file files ) ; and the temporary one
906- (setq tree (git-write-tree index-file)))
907- (if (or (not (string-equal tree head-tree))
908- (yes-or-no-p " The tree was not modified, do you really want to perform an empty commit? " ))
909- (let ((commit (git-commit-tree buffer tree head)))
910- (when commit
911- (condition-case nil (delete-file " .git/MERGE_HEAD" ) (error nil ))
912- (condition-case nil (delete-file " .git/MERGE_MSG" ) (error nil ))
913- (with-current-buffer buffer (erase-buffer ))
914- (git-update-status-files (git-get-filenames files ))
915- (git-call-process nil " rerere" )
916- (git-call-process nil " gc" " --auto" )
917- (message " Committed %s . " commit)
918- (git-run-hook " post-commit" nil )))
919- (message " Commit aborted. " ))))
920- (message " No files to commit. " )))
898+ (message " Running git commit... " )
899+ (when
900+ (and
901+ (git-read-tree head-tree index-file)
902+ (git-update-index nil files ) ; update both the default index
903+ (git-update-index index-file files ) ; and the temporary one
904+ (setq tree (git-write-tree index-file)))
905+ (if (or (not (string-equal tree head-tree))
906+ (yes-or-no-p " The tree was not modified, do you really want to perform an empty commit? " ))
907+ (let ((commit (git-commit-tree buffer tree head)))
908+ (when commit
909+ (condition-case nil (delete-file " .git/MERGE_HEAD" ) (error nil ))
910+ (condition-case nil (delete-file " .git/MERGE_MSG" ) (error nil ))
911+ (with-current-buffer buffer (erase-buffer ))
912+ (git-update-status-files (git-get-filenames files ))
913+ (git-call-process nil " rerere" )
914+ (git-call-process nil " gc" " --auto" )
915+ (message " Committed %s . " commit)
916+ (git-run-hook " post-commit" nil )))
917+ (message " Commit aborted. " ))))
921918 (delete-file index-file))))))
922919
923920
0 commit comments