fix files not being committed

This commit is contained in:
Mohamed 2017-06-15 14:08:16 +02:00
parent 496d058819
commit 848bc87d3f
3 changed files with 6 additions and 5 deletions

View file

@ -573,13 +573,13 @@ public class PasswordStore extends AppCompatActivity {
public void execute(boolean finishOnEnd) {
Log.d(TAG, "Commiting with message " + message);
Git git = new Git(this.repository);
GitAsyncTask tasks = new GitAsyncTask(activity, false, true, this);
GitAsyncTask tasks = new GitAsyncTask(activity, finishOnEnd, true, this);
tasks.execute(
git.add().addFilepattern("."),
git.commit().setMessage(message)
git.commit().setAll(true).setMessage(message)
);
}
}.execute(true);
}.execute(false);
}
protected void onActivityResult(int requestCode, int resultCode,

View file

@ -64,7 +64,8 @@ public class GitAsyncTask extends AsyncTask<GitCommand, String, String> {
try {
if (command instanceof StatusCommand) {
// in case we have changes, we want to keep track of it
nbChanges = ((StatusCommand) command).call().getChanged().size();
org.eclipse.jgit.api.Status status = ((StatusCommand) command).call();
nbChanges = status.getChanged().size() + status.getMissing().size();
} else if (command instanceof CommitCommand) {
// the previous status will eventually be used to avoid a commit
if (nbChanges == null || nbChanges > 0)

View file

@ -41,7 +41,7 @@ public class SyncOperation extends GitOperation {
Git git = new Git(repository);
this.addCommand = git.add().addFilepattern(".");
this.statusCommand = git.status();
this.commitCommand = git.commit().setMessage("[Android Password Store] Sync");
this.commitCommand = git.commit().setAll(true).setMessage("[Android Password Store] Sync");
this.pullCommand = git.pull().setRebase(true).setRemote("origin");
this.pushCommand = git.push().setPushAll().setRemote("origin");
return this;