From e170ef281b4d8f9b4c49d41faa077b06b1c9a84a Mon Sep 17 00:00:00 2001 From: zeapo Date: Sun, 4 Jan 2015 16:27:26 +0100 Subject: [PATCH] uri is useless here --- .../main/java/com/zeapo/pwdstore/git/GitActivity.java | 10 +++++----- .../java/com/zeapo/pwdstore/git/PullOperation.java | 5 ++--- .../java/com/zeapo/pwdstore/git/PushOperation.java | 5 ++--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java index 5bb44b32..6307fd0d 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java @@ -464,7 +464,7 @@ public class GitActivity extends ActionBarActivity { username = hostname.split("@")[0]; } - if (localDir.exists()) { + if (localDir.exists() && localDir.listFiles().length != 0) { new AlertDialog.Builder(this). setTitle(R.string.dialog_delete_title). setMessage(R.string.dialog_delete_msg). @@ -565,9 +565,9 @@ public class GitActivity extends ActionBarActivity { GitOperation op; if (operation == REQUEST_PULL) { - op = new PullOperation(localDir, activity).setCommand(hostname); + op = new PullOperation(localDir, activity).setCommand(); } else if (operation == REQUEST_PUSH) { - op = new PushOperation(localDir, activity).setCommand(hostname); + op = new PushOperation(localDir, activity).setCommand(); } else { Log.e(TAG, "Sync operation not recognized : " + operation); return; @@ -594,11 +594,11 @@ public class GitActivity extends ActionBarActivity { switch (requestCode) { case REQUEST_PULL: - op = new PullOperation(localDir, activity).setCommand(hostname); + op = new PullOperation(localDir, activity).setCommand(); break; case REQUEST_PUSH: - op = new PushOperation(localDir, activity).setCommand(hostname); + op = new PushOperation(localDir, activity).setCommand(); break; case GitOperation.GET_SSH_KEY_FROM_CLONE: diff --git a/app/src/main/java/com/zeapo/pwdstore/git/PullOperation.java b/app/src/main/java/com/zeapo/pwdstore/git/PullOperation.java index 2d499b4e..abf4bfe6 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/PullOperation.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/PullOperation.java @@ -20,11 +20,10 @@ public class PullOperation extends GitOperation { } /** - * Sets the command using the repository uri - * @param uri the uri of the repository + * Sets the command * @return the current object */ - public PullOperation setCommand(String uri) { + public PullOperation setCommand() { this.command = new Git(repository) .pull() .setRebase(true) diff --git a/app/src/main/java/com/zeapo/pwdstore/git/PushOperation.java b/app/src/main/java/com/zeapo/pwdstore/git/PushOperation.java index fd4fb229..73ed05ff 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/PushOperation.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/PushOperation.java @@ -20,11 +20,10 @@ public class PushOperation extends GitOperation { } /** - * Sets the command using the repository uri - * @param uri the uri of the repository + * Sets the command * @return the current object */ - public PushOperation setCommand(String uri) { + public PushOperation setCommand() { this.command = new Git(repository) .push() .setPushAll()