Skip to content

Commit 97a8554

Browse files
authored
Make the calls to crate::init() consistent (#604)
This change makes the calls to `crate::init()` in `src/repo.rs` all use the full namespace for consistency. This makes no difference, but makes it easier to find (e.g. through a simple `grep`) which functions eventually invoke `git_libgit2_init()`.
1 parent a9d86f4 commit 97a8554

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/repo.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use crate::util::{self, path_to_repo_path, Binding};
1919
use crate::CherrypickOptions;
2020
use crate::RevertOptions;
2121
use crate::{
22-
init, raw, AttrCheckFlags, Buf, Error, Object, Remote, RepositoryOpenFlags, RepositoryState,
23-
Revspec, StashFlags,
22+
raw, AttrCheckFlags, Buf, Error, Object, Remote, RepositoryOpenFlags, RepositoryState, Revspec,
23+
StashFlags,
2424
};
2525
use crate::{
2626
AnnotatedCommit, MergeAnalysis, MergeOptions, MergePreference, SubmoduleIgnore, SubmoduleStatus,
@@ -65,7 +65,7 @@ impl Repository {
6565
///
6666
/// The path can point to either a normal or bare repository.
6767
pub fn open<P: AsRef<Path>>(path: P) -> Result<Repository, Error> {
68-
init();
68+
crate::init();
6969
// Normal file path OK (does not need Windows conversion).
7070
let path = path.as_ref().into_c_string()?;
7171
let mut ret = ptr::null_mut();
@@ -79,7 +79,7 @@ impl Repository {
7979
///
8080
/// The path can point to only a bare repository.
8181
pub fn open_bare<P: AsRef<Path>>(path: P) -> Result<Repository, Error> {
82-
init();
82+
crate::init();
8383
// Normal file path OK (does not need Windows conversion).
8484
let path = path.as_ref().into_c_string()?;
8585
let mut ret = ptr::null_mut();
@@ -95,7 +95,7 @@ impl Repository {
9595
/// With `$GIT_DIR` unset, this will search for a repository starting in
9696
/// the current directory.
9797
pub fn open_from_env() -> Result<Repository, Error> {
98-
init();
98+
crate::init();
9999
let mut ret = ptr::null_mut();
100100
let flags = raw::GIT_REPOSITORY_OPEN_FROM_ENV;
101101
unsafe {
@@ -145,7 +145,7 @@ impl Repository {
145145
O: AsRef<OsStr>,
146146
I: IntoIterator<Item = O>,
147147
{
148-
init();
148+
crate::init();
149149
// Normal file path OK (does not need Windows conversion).
150150
let path = path.as_ref().into_c_string()?;
151151
let ceiling_dirs_os = env::join_paths(ceiling_dirs)?;
@@ -168,7 +168,7 @@ impl Repository {
168168
/// until it finds a repository.
169169
pub fn discover<P: AsRef<Path>>(path: P) -> Result<Repository, Error> {
170170
// TODO: this diverges significantly from the libgit2 API
171-
init();
171+
crate::init();
172172
let buf = Buf::new();
173173
// Normal file path OK (does not need Windows conversion).
174174
let path = path.as_ref().into_c_string()?;
@@ -206,7 +206,7 @@ impl Repository {
206206
path: P,
207207
opts: &RepositoryInitOptions,
208208
) -> Result<Repository, Error> {
209-
init();
209+
crate::init();
210210
// Normal file path OK (does not need Windows conversion).
211211
let path = path.as_ref().into_c_string()?;
212212
let mut ret = ptr::null_mut();
@@ -238,7 +238,7 @@ impl Repository {
238238

239239
/// Attempt to wrap an object database as a repository.
240240
pub fn from_odb(odb: Odb<'_>) -> Result<Repository, Error> {
241-
init();
241+
crate::init();
242242
let mut ret = ptr::null_mut();
243243
unsafe {
244244
try_call!(raw::git_repository_wrap_odb(&mut ret, odb.raw()));

0 commit comments

Comments
 (0)