Skip to content

Commit

Permalink
fixed add all action has not add deleted files on working tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank997 committed Jun 26, 2022
1 parent 106949b commit 39b6223
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ protected void onPostExecute(Boolean isSuccess) {

public boolean addToStage() {
try {
mRepo.getGit().add().addFilepattern(mFilePattern).call();
// jGit hasn't a cmd direct add modified/new/deleted files, so if want to add
// those 3 types changed, need a combined call like below.
// check it: https://stackoverflow.com/a/59434085

//add modified/new files
mRepo.getGit().add().setUpdate(false).addFilepattern(mFilePattern).call();
//add modified/deleted files
mRepo.getGit().add().setUpdate(true).addFilepattern(mFilePattern).call();
} catch (StopTaskException e) {
return false;
} catch (Throwable e) {
Expand Down

0 comments on commit 39b6223

Please sign in to comment.