feat: turn of advice about detached head

Previously, every run log would contain:

    Note: switching to 'HEAD^'.

    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.

    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:

      git switch -c <new-branch-name>

    Or undo this operation with:

      git switch -

    Turn off this advice by setting config variable advice.detachedHead to false

    HEAD is now at 2d0d98e feat: add branch or patch information to run log

This should now be gone.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
Lars Wirzenius
2024-03-31 16:21:28 +03:00
parent 332cf7eea7
commit 8c74e710b2
+1
View File
@@ -176,6 +176,7 @@ impl Run {
}
fn git_checkout(&mut self, commit: Oid, src: &Path) -> Result<(), RunError> {
self.runcmd(&["git", "config", "advice.detachedHead", "false"], src)?;
self.runcmd(&["git", "checkout", &commit.to_string()], src)?;
Ok(())
}