File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,17 @@ impl crate::Repository {
15
15
self . options . git_dir_trust . expect ( "definitely set by now" )
16
16
}
17
17
18
+ /// Return the current working directory as present during the instantiation of this repository.
19
+ ///
20
+ /// Note that this should be preferred over manually obtaining it as this may have been adjusted to
21
+ /// deal with `core.precomposeUnicode`.
22
+ pub fn current_dir ( & self ) -> & Path {
23
+ self . options
24
+ . current_dir
25
+ . as_deref ( )
26
+ . expect ( "BUG: cwd is always set after instantiation" )
27
+ }
28
+
18
29
/// Returns the main git repository if this is a repository on a linked work-tree, or the `git_dir` itself.
19
30
pub fn common_dir ( & self ) -> & std:: path:: Path {
20
31
self . common_dir . as_deref ( ) . unwrap_or_else ( || self . git_dir ( ) )
You can’t perform that action at this time.
0 commit comments