Skip to content

Commit

Permalink
handle with GetEntry change (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Jun 21, 2023
1 parent 81cb297 commit 73498d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ var addCmd = &cobra.Command{

// If the file does not exist but is registered in the index, delete it from the index
if _, err := os.Stat(arg); os.IsNotExist(err) {
_, entry, isEntryFound := client.Idx.GetEntry([]byte(cleanedArg))
_, _, isEntryFound := client.Idx.GetEntry([]byte(cleanedArg))
if !isEntryFound {
return fmt.Errorf(`path "%s" did not match any files`, arg)
}
if err := client.Idx.DeleteEntry(client.RootGoitPath, entry); err != nil {
if err := client.Idx.DeleteEntry(client.RootGoitPath, []byte(cleanedArg)); err != nil {
return fmt.Errorf("fail to delete untracked file %s: %w", cleanedArg, err)
}
continue
Expand Down

0 comments on commit 73498d2

Please sign in to comment.