Git development
 help / color / mirror / Atom feed
* "git checkout" resets modified files
@ 2015-08-29  6:15 Steve Heyns
  2015-08-29  7:15 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Heyns @ 2015-08-29  6:15 UTC (permalink / raw)
  To: git

"git checkout" resets modified files

Version git  2.5.0,

Description:
I was automating a process that would pull and switch to another
branch when I stumbled across this. I have not been able to emulate
this from command line but using go (or I imagine other languages are
similar) if you execute a command like

exec.Command("git","checkout","")

A checkout with the branch parameter but the branch parameter is empty.

The result is git resets the the repository, modified files are reset
back to original state without warning.

I would expect the behavior should be the same as a "git checkout" command

Has anyone else seen something like this ? For myself the solution was
to simply suppress passing in the revision as a third argument if the
revision was empty. But this does appear to be an off behavior.

Thanks
Nz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-29  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-29  6:15 "git checkout" resets modified files Steve Heyns
2015-08-29  7:15 ` Junio C Hamano
2015-08-29  7:58   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox