Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 848bc87

Browse files
committed
fix files not being committed
1 parent 496d058 commit 848bc87

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

app/src/main/java/com/zeapo/pwdstore/PasswordStore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,13 @@ private void commitChange(final String message) {
573573
public void execute(boolean finishOnEnd) {
574574
Log.d(TAG, "Commiting with message " + message);
575575
Git git = new Git(this.repository);
576-
GitAsyncTask tasks = new GitAsyncTask(activity, false, true, this);
576+
GitAsyncTask tasks = new GitAsyncTask(activity, finishOnEnd, true, this);
577577
tasks.execute(
578578
git.add().addFilepattern("."),
579-
git.commit().setMessage(message)
579+
git.commit().setAll(true).setMessage(message)
580580
);
581581
}
582-
}.execute(true);
582+
}.execute(false);
583583
}
584584

585585
protected void onActivityResult(int requestCode, int resultCode,

app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ protected String doInBackground(GitCommand... commands) {
6464
try {
6565
if (command instanceof StatusCommand) {
6666
// in case we have changes, we want to keep track of it
67-
nbChanges = ((StatusCommand) command).call().getChanged().size();
67+
org.eclipse.jgit.api.Status status = ((StatusCommand) command).call();
68+
nbChanges = status.getChanged().size() + status.getMissing().size();
6869
} else if (command instanceof CommitCommand) {
6970
// the previous status will eventually be used to avoid a commit
7071
if (nbChanges == null || nbChanges > 0)

app/src/main/java/com/zeapo/pwdstore/git/SyncOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public SyncOperation setCommands() {
4141
Git git = new Git(repository);
4242
this.addCommand = git.add().addFilepattern(".");
4343
this.statusCommand = git.status();
44-
this.commitCommand = git.commit().setMessage("[Android Password Store] Sync");
44+
this.commitCommand = git.commit().setAll(true).setMessage("[Android Password Store] Sync");
4545
this.pullCommand = git.pull().setRebase(true).setRemote("origin");
4646
this.pushCommand = git.push().setPushAll().setRemote("origin");
4747
return this;

0 commit comments

Comments
 (0)