mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-01 06:45:19 +00:00
check that we have a repository before cloning
This commit is contained in:
@@ -439,6 +439,9 @@ public class GitActivity extends AppCompatActivity {
|
|||||||
* @param view
|
* @param view
|
||||||
*/
|
*/
|
||||||
public void cloneRepository(View view) {
|
public void cloneRepository(View view) {
|
||||||
|
if (PasswordRepository.getRepository(null) == null) {
|
||||||
|
PasswordRepository.initialize(this);
|
||||||
|
}
|
||||||
localDir = PasswordRepository.getWorkTree();
|
localDir = PasswordRepository.getWorkTree();
|
||||||
hostname = ((EditText) findViewById(R.id.clone_uri)).getText().toString();
|
hostname = ((EditText) findViewById(R.id.clone_uri)).getText().toString();
|
||||||
port = ((EditText) findViewById(R.id.server_port)).getText().toString();
|
port = ((EditText) findViewById(R.id.server_port)).getText().toString();
|
||||||
|
@@ -37,7 +37,7 @@ public class PasswordRepository {
|
|||||||
* @return the git repository
|
* @return the git repository
|
||||||
*/
|
*/
|
||||||
public static Repository getRepository(File localDir) {
|
public static Repository getRepository(File localDir) {
|
||||||
if (repository == null) {
|
if (repository == null && localDir != null) {
|
||||||
FileRepositoryBuilder builder = new FileRepositoryBuilder();
|
FileRepositoryBuilder builder = new FileRepositoryBuilder();
|
||||||
try {
|
try {
|
||||||
repository = builder.setGitDir(localDir)
|
repository = builder.setGitDir(localDir)
|
||||||
|
Reference in New Issue
Block a user