Skip to content

core.excludesFile config entry exists but has blank value causes error: is this considered a bug or expected behavior? #1370

Closed
@nerditation

Description

@nerditation

I encountered this error when building docs using cargo doc for my project. I did some digging. and managed to locate where the error originated: in config::Cache::excludes_file() it calls self.trusted_file_path() to get the path for the EXCLUDES_FILE:

https://github.com/Byron/gitoxide/blob/d3588ca4fe0364c88e42cdac24ceae548355d99d/gix/src/config/cache/access.rs#L208-L212

in trusted_file_path(), self.resvoled.path_fillter(...) returns a value of Some("") (it's actual type is Path not &str but you get the point) which cause path.interpolate(ctx) to return an Err(interpolate::Error):

https://github.com/Byron/gitoxide/blob/d3588ca4fe0364c88e42cdac24ceae548355d99d/gix/src/config/cache/access.rs#L222-L232


it turns out in my git config file, there exists an entry for core.excludesfile, but it's value is blank:

[core]
	excludesfile =

I don't remember how it came to be, I think this might be a leftover by the SourceTree GUI app.

and I'm not sure if this is expected behavior or misbehavior, but apparently libgit2 didn't treat this as an error case.

I guess another way to state question is, should path_filter() return Some("") or should it return None for an blank path?

Metadata

Metadata

Assignees

Labels

acknowledgedan issue is accepted as shortcoming to be fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions