File tree 2 files changed +5
-4
lines changed 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -805,7 +805,7 @@ fn check_repo_state(
805
805
return Ok ( Some ( VcsInfo { git, path_in_vcs } ) ) ;
806
806
807
807
fn git (
808
- pkg : & Package ,
808
+ _pkg : & Package ,
809
809
src_files : & [ PathBuf ] ,
810
810
repo : & git2:: Repository ,
811
811
opts : & PackageOpts < ' _ > ,
@@ -824,11 +824,12 @@ fn check_repo_state(
824
824
// Find the intersection of dirty in git, and the src_files that would
825
825
// be packaged. This is a lazy n^2 check, but seems fine with
826
826
// thousands of files.
827
+ let workdir = repo. workdir ( ) . unwrap ( ) ;
827
828
let mut dirty_src_files: Vec < _ > = src_files
828
829
. iter ( )
829
830
. filter ( |src_file| dirty_files. iter ( ) . any ( |path| src_file. starts_with ( path) ) )
830
831
. map ( |path| {
831
- path. strip_prefix ( pkg . root ( ) )
832
+ path. strip_prefix ( workdir )
832
833
. unwrap_or ( path)
833
834
. display ( )
834
835
. to_string ( )
Original file line number Diff line number Diff line change @@ -1217,8 +1217,8 @@ fn dirty_workspace_package() {
1217
1217
[PACKAGED] 5 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
1218
1218
[ERROR] 2 files in the working directory contain changes that were not yet committed into git:
1219
1219
1220
- src/lib.rs
1221
- src/main.rs
1220
+ mordor/ src/lib.rs
1221
+ mordor/ src/main.rs
1222
1222
1223
1223
to proceed despite this and include the uncommitted changes, pass the `--allow-dirty` flag
1224
1224
You can’t perform that action at this time.
0 commit comments