File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -2065,6 +2065,13 @@ impl Repository {
2065
2065
2066
2066
/// Updates files in the index and the working tree to match the content of
2067
2067
/// the commit pointed at by HEAD.
2068
+ ///
2069
+ /// Note that this is _not_ the correct mechanism used to switch branches;
2070
+ /// do not change your `HEAD` and then call this method, that would leave
2071
+ /// you with checkout conflicts since your working directory would then
2072
+ /// appear to be dirty. Instead, checkout the target of the branch and
2073
+ /// then update `HEAD` using [`Repository::set_head`] to point to the
2074
+ /// branch you checked out.
2068
2075
pub fn checkout_head ( & self , opts : Option < & mut CheckoutBuilder < ' _ > > ) -> Result < ( ) , Error > {
2069
2076
unsafe {
2070
2077
let mut raw_opts = mem:: zeroed ( ) ;
You can’t perform that action at this time.
0 commit comments