step thirty seven: set head to master on init
This commit is contained in:
parent
b54604ac72
commit
e0392ead71
|
@ -1,3 +1,3 @@
|
|||
/target
|
||||
/test
|
||||
/test*
|
||||
.rgit
|
||||
|
|
13
src/base.rs
13
src/base.rs
|
@ -215,6 +215,19 @@ pub fn create_branch(name: String, oid: String) {
|
|||
);
|
||||
}
|
||||
|
||||
pub fn init() -> std::io::Result<()> {
|
||||
data::init()?;
|
||||
data::update_ref(
|
||||
"HEAD".to_owned(),
|
||||
data::RefValue {
|
||||
symbolic: true,
|
||||
value: "refs/heads/master".to_owned(),
|
||||
},
|
||||
true,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn is_ignored(path: &String) -> bool {
|
||||
if path.contains(".rgit") {
|
||||
true
|
||||
|
|
|
@ -83,7 +83,7 @@ fn main() {
|
|||
}
|
||||
|
||||
fn init() {
|
||||
match data::init() {
|
||||
match base::init() {
|
||||
Ok(()) => println!("Repository created"),
|
||||
_ => println!("Failed. Perhaps the repository already exists."),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue