File tree Expand file tree Collapse file tree 3 files changed +6
-28
lines changed
git-branchless-invoke/src
git-branchless-lib/src/git
git-branchless-reword/src Expand file tree Collapse file tree 3 files changed +6
-28
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,11 @@ fn install_tracing(effects: Effects) -> eyre::Result<impl Drop> {
6969 Ok ( nesting_level) => nesting_level. parse :: < usize > ( ) . unwrap_or_default ( ) ,
7070 Err ( _) => 0 ,
7171 } ;
72- std:: env:: set_var ( NESTING_LEVEL_KEY , ( nesting_level + 1 ) . to_string ( ) ) ;
72+ // SAFETY: We're setting an environment variable that we control and read immediately
73+ // after. This is done at the start of execution before any threading occurs.
74+ unsafe {
75+ std:: env:: set_var ( NESTING_LEVEL_KEY , ( nesting_level + 1 ) . to_string ( ) ) ;
76+ }
7377
7478 let should_include_function_args = match std:: env:: var ( "RUST_PROFILE_INCLUDE_ARGS" ) {
7579 Ok ( value) if !value. is_empty ( ) => true ,
Original file line number Diff line number Diff line change @@ -1540,7 +1540,7 @@ impl Repo {
15401540 let mut result = self . get_paths_touched_by_commit ( parent_commit) ?;
15411541 match opts {
15421542 AmendFastOptions :: FromIndex { paths } => result. extend ( paths. iter ( ) . cloned ( ) ) ,
1543- AmendFastOptions :: FromWorkingCopy { ref status_entries } => {
1543+ AmendFastOptions :: FromWorkingCopy { status_entries } => {
15441544 for entry in status_entries {
15451545 result. extend ( entry. paths ( ) . iter ( ) . cloned ( ) ) ;
15461546 }
Original file line number Diff line number Diff line change @@ -673,32 +673,6 @@ fn parse_bulk_edit_message(
673673 } )
674674}
675675
676- /// Return the root commits for given a list of commits. This is the list of commits that have *no*
677- /// ancestors also in the list. The idea is to find the minimum number of subtrees that much be
678- /// rebased to include all of our rewording.
679- #[ instrument]
680- fn find_subtree_roots < ' repo > (
681- repo : & ' repo Repo ,
682- dag : & Dag ,
683- commits : & [ Commit ] ,
684- ) -> eyre:: Result < Vec < Commit < ' repo > > > {
685- let commits: CommitSet = commits. iter ( ) . map ( |commit| commit. get_oid ( ) ) . collect ( ) ;
686-
687- // Find the vertices representing the roots of this set of commits
688- let subtree_roots = dag
689- . query_roots ( commits)
690- . wrap_err ( "Computing subtree roots" ) ?;
691-
692- // convert the vertices back into actual Commits
693- let root_commits = dag
694- . commit_set_to_vec ( & subtree_roots) ?
695- . into_iter ( )
696- . filter_map ( |oid| repo. find_commit ( oid) . ok ( ) ?)
697- . collect ( ) ;
698-
699- Ok ( root_commits)
700- }
701-
702676/// Print a basic status report of what commits were reworded.
703677#[ instrument]
704678fn render_status_report (
You can’t perform that action at this time.
0 commit comments