File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ impl From<git_discover::repository::Kind> for Kind {
219
219
fn from ( v : git_discover:: repository:: Kind ) -> Self {
220
220
match v {
221
221
git_discover:: repository:: Kind :: Bare => Kind :: Bare ,
222
+ git_discover:: repository:: Kind :: WorkTreeGitDir { .. } => Kind :: WorkTree { is_linked : true } ,
222
223
git_discover:: repository:: Kind :: WorkTree { linked_git_dir } => Kind :: WorkTree {
223
224
is_linked : linked_git_dir. is_some ( ) ,
224
225
} ,
Original file line number Diff line number Diff line change @@ -34,16 +34,14 @@ impl<'repo> Proxy<'repo> {
34
34
/// Note that the location might not exist.
35
35
pub fn base ( & self ) -> std:: io:: Result < PathBuf > {
36
36
let git_dir = self . git_dir . join ( "gitdir" ) ;
37
- let mut base_dot_git = git_discover:: path:: from_plain_file ( & git_dir) . ok_or_else ( || {
37
+ let base_dot_git = git_discover:: path:: from_plain_file ( & git_dir) . ok_or_else ( || {
38
38
std:: io:: Error :: new (
39
39
std:: io:: ErrorKind :: NotFound ,
40
40
format ! ( "Required file '{}' does not exist" , git_dir. display( ) ) ,
41
41
)
42
42
} ) ??;
43
- if base_dot_git. file_name ( ) . and_then ( |n| n. to_str ( ) ) == Some ( ".git" ) {
44
- base_dot_git. pop ( ) ;
45
- }
46
- Ok ( base_dot_git)
43
+
44
+ Ok ( git_discover:: path:: without_dot_git_dir ( base_dot_git) )
47
45
}
48
46
49
47
/// The git directory for the work tree, typically contained within the parent git dir.
You can’t perform that action at this time.
0 commit comments