Skip to content

Commit 5771721

Browse files
committed
avoid extra copies of paths using PathCursor tool during repo init
1 parent 84b98d9 commit 5771721

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git-repository/src/create.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,11 @@ pub fn into(
190190
core.push(key("ignorecase"), bool(caps.ignore_case));
191191
core.push(key("precomposeunicode"), bool(caps.precompose_unicode));
192192
}
193-
let config_path = dot_git.join("config");
193+
let mut cursor = PathCursor(&mut dot_git);
194+
let config_path = cursor.at("config");
194195
std::fs::write(&config_path, &config.to_bstring()).map_err(|err| Error::IoWrite {
195196
source: err,
196-
path: config_path,
197+
path: config_path.to_owned(),
197198
})?;
198199
}
199200

0 commit comments

Comments
 (0)