File tree 2 files changed +5
-5
lines changed 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -796,7 +796,7 @@ fn check_repo_state(
796
796
. and_then ( |p| p. to_str ( ) )
797
797
. unwrap_or ( "" )
798
798
. replace ( "\\ " , "/" ) ;
799
- let Some ( git) = git ( p , src_files, & repo, & opts) ? else {
799
+ let Some ( git) = git ( src_files, & repo, & opts) ? else {
800
800
// If the git repo lacks essensial field like `sha1`, and since this field exists from the beginning,
801
801
// then don't generate the corresponding file in order to maintain consistency with past behavior.
802
802
return Ok ( None ) ;
@@ -805,7 +805,6 @@ fn check_repo_state(
805
805
return Ok ( Some ( VcsInfo { git, path_in_vcs } ) ) ;
806
806
807
807
fn git (
808
- pkg : & Package ,
809
808
src_files : & [ PathBuf ] ,
810
809
repo : & git2:: Repository ,
811
810
opts : & PackageOpts < ' _ > ,
@@ -824,11 +823,12 @@ fn check_repo_state(
824
823
// Find the intersection of dirty in git, and the src_files that would
825
824
// be packaged. This is a lazy n^2 check, but seems fine with
826
825
// thousands of files.
826
+ let workdir = repo. workdir ( ) . unwrap ( ) ;
827
827
let mut dirty_src_files: Vec < _ > = src_files
828
828
. iter ( )
829
829
. filter ( |src_file| dirty_files. iter ( ) . any ( |path| src_file. starts_with ( path) ) )
830
830
. map ( |path| {
831
- path. strip_prefix ( pkg . root ( ) )
831
+ path. strip_prefix ( workdir )
832
832
. unwrap_or ( path)
833
833
. display ( )
834
834
. to_string ( )
Original file line number Diff line number Diff line change @@ -1220,8 +1220,8 @@ fn vcs_status_check_for_each_workspace_member() {
1220
1220
[PACKAGED] 5 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
1221
1221
[ERROR] 2 files in the working directory contain changes that were not yet committed into git:
1222
1222
1223
- src/lib.rs
1224
- src/main.rs
1223
+ mordor/ src/lib.rs
1224
+ mordor/ src/main.rs
1225
1225
1226
1226
to proceed despite this and include the uncommitted changes, pass the `--allow-dirty` flag
1227
1227
You can’t perform that action at this time.
0 commit comments