Skip to content

Commit a89a667

Browse files
committed
refactor (#301)
1 parent 42a6c8c commit a89a667

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

git-repository/src/worktree.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,10 @@ impl<'repo> crate::Worktree<'repo> {
7373
overrides.unwrap_or_default(),
7474
git_attributes::MatchGroup::<git_attributes::Ignore>::from_git_dir(
7575
repo.git_dir(),
76-
repo.config
77-
.excludes_file
78-
.as_ref()
79-
.map(|p| Ok(Some(p.to_owned())))
80-
.or_else(|| repo.config.xdg_config_path("ignore").into())
81-
.transpose()?
82-
.flatten(),
76+
match repo.config.excludes_file.as_ref() {
77+
Some(user_path) => Some(user_path.to_owned()),
78+
None => repo.config.xdg_config_path("ignore")?,
79+
},
8380
&mut buf,
8481
)?,
8582
None,

0 commit comments

Comments
 (0)