aboutsummaryrefslogtreecommitdiffstats
path: root/options.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-09-01 17:26:52 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-09-01 17:26:52 +0200
commitf1e58e0d30095cf768ff04d379b5e4145a874be8 (patch)
tree1922e3a721c4c19889557f96108076c325b95fbd /options.go
parent3ca370277427c5d508f0dedacbd559523a305121 (diff)
downloadgo-git-f1e58e0d30095cf768ff04d379b5e4145a874be8.tar.gz
Worktree.Reset ignore untracked files on Merge mode
Diffstat (limited to 'options.go')
-rw-r--r--options.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/options.go b/options.go
index 0ec18d4..02fb926 100644
--- a/options.go
+++ b/options.go
@@ -238,13 +238,13 @@ func (o *CheckoutOptions) Validate() error {
type ResetMode int8
const (
- // HardReset resets the index and working tree. Any changes to tracked files
- // in the working tree are discarded.
- HardReset ResetMode = iota
// MixedReset resets the index but not the working tree (i.e., the changed
// files are preserved but not marked for commit) and reports what has not
// been updated. This is the default action.
- MixedReset
+ MixedReset ResetMode = iota
+ // HardReset resets the index and working tree. Any changes to tracked files
+ // in the working tree are discarded.
+ HardReset
// MergeReset resets the index and updates the files in the working tree
// that are different between Commit and HEAD, but keeps those which are
// different between the index and working tree (i.e. which have changes
@@ -253,6 +253,10 @@ const (
// If a file that is different between Commit and the index has unstaged
// changes, reset is aborted.
MergeReset
+ // SoftReset does not touch the index file or the working tree at all (but
+ // resets the head to <commit>, just like all modes do). This leaves all
+ // your changed files "Changes to be committed", as git status would put it.
+ SoftReset
)
// ResetOptions describes how a reset operation should be performed.