Skip to content

Commit

Permalink
Complete 'git rm' with files deleted from working tree
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Aug 9, 2010
1 parent 9d26b51 commit 223c61a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions GitTabExpansion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ function script:gitFiles($filter) {
}
}

function script:gitDeleted($filter) {
if($GitStatus) {
$GitStatus.Working.Deleted |
where { $_ -like "$filter*" } |
foreach { if($_ -like '* *') { "'$_'" } else { $_ } }
}
}

function script:gitAliases($filter) {
$aliasList = @()
git config --get-regexp alias\..+ | foreach {
Expand Down Expand Up @@ -104,7 +112,7 @@ function GitTabExpansion($lastBlock) {
}

# Handles git branch -d|-D|-m|-M <branch name>
# Handles git branch <branch name> <start-point>
# Handles git branch <branch name> <start-point>
'git branch.* (\S*)$' {
gitLocalBranches $matches[1]
}
Expand Down Expand Up @@ -154,7 +162,7 @@ function GitTabExpansion($lastBlock) {

# Handles git rm <path>
'git rm.* (\S*)$' {
gitIndex $matches[1]
gitDeleted $matches[1]
}

# Handles git checkout <branch name>
Expand Down

0 comments on commit 223c61a

Please sign in to comment.