aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_status.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-04-18 16:37:30 +0200
committerGitHub <noreply@github.com>2018-04-18 16:37:30 +0200
commit87cc8192de93dcf7b843058f11ad85200d46bb0c (patch)
treedafcbe0c3c76881e7066c8505a8cdbf92be9f8ec /worktree_status.go
parentb30763cb64afa91c016b23e905af0a378eb1b76d (diff)
parent6b33126e79695b499d7d519f69db4ca1ebd22dd1 (diff)
downloadgo-git-87cc8192de93dcf7b843058f11ad85200d46bb0c.tar.gz
Merge pull request #815 from kuba--/fix-worktree/814
Fix for "Worktree Add function adds ".git" directory"
Diffstat (limited to 'worktree_status.go')
-rw-r--r--worktree_status.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/worktree_status.go b/worktree_status.go
index 2cac78e..b5f2381 100644
--- a/worktree_status.go
+++ b/worktree_status.go
@@ -300,6 +300,10 @@ func (w *Worktree) doAddDirectory(idx *index.Index, s Status, directory string)
var a bool
if file.IsDir() {
+ if file.Name() == GitDirName {
+ // ignore special git directory
+ continue
+ }
a, err = w.doAddDirectory(idx, s, name)
} else {
a, _, err = w.doAddFile(idx, s, name)