diff options
author | Mohamed <mohamed@zenadi.com> | 2017-06-15 14:08:16 +0200 |
---|---|---|
committer | Mohamed <mohamed@zenadi.com> | 2017-06-15 14:08:16 +0200 |
commit | 848bc87d3fcc0d33cd29a9dd4541dbe6d6b44352 (patch) | |
tree | fdb052e1f39e2f4e42d0deaf64c2d4c2d4afe634 /app/src/main/java | |
parent | 496d058819ef42d37064012befe4d3197c0f942d (diff) |
fix files not being committed
Diffstat (limited to 'app/src/main/java')
3 files changed, 6 insertions, 5 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 4fb21428..2fe1cf10 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -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, diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.java b/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.java index ad93b2ce..fa323bf4 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.java @@ -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) diff --git a/app/src/main/java/com/zeapo/pwdstore/git/SyncOperation.java b/app/src/main/java/com/zeapo/pwdstore/git/SyncOperation.java index 128713e9..21e59e61 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/SyncOperation.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/SyncOperation.java @@ -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; |