From b5682c764a3dcca918663f9c7fd39b5845e7fd3e Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Tue, 10 Oct 2017 22:43:48 +0300 Subject: [PATCH] git: treat 'clone' as a read command IDEA-179899 In fact, clone is a write command, because it modifies index.lock; however that index.lock is in new repository => it can't be accessed by any other command at the same time. If the clone is performed into a subfolder of the current project, it still can't interfere with any other Git command, because the subfolder must be empty (otherwise clone won't start). This change allows however to call two clones into the same directory simultaneously, and one of them will fail, but that doesn't look like a serious issue and should anyway be solved by a more high-level IDEA-90211. --- plugins/git4idea/src/git4idea/commands/GitCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git4idea/src/git4idea/commands/GitCommand.java b/plugins/git4idea/src/git4idea/commands/GitCommand.java index 3f6ae394c225..8b0711e9c9fc 100644 --- a/plugins/git4idea/src/git4idea/commands/GitCommand.java +++ b/plugins/git4idea/src/git4idea/commands/GitCommand.java @@ -43,7 +43,7 @@ public class GitCommand { public static final GitCommand CONFIG = read("config"); public static final GitCommand CHERRY = read("cherry"); public static final GitCommand CHERRY_PICK = write("cherry-pick"); - public static final GitCommand CLONE = write("clone"); + public static final GitCommand CLONE = read("clone"); // write, but can't interfere with any other command => should be treated as read public static final GitCommand DIFF = read("diff"); public static final GitCommand FETCH = read("fetch"); // fetch is a read-command, because it doesn't modify the index public static final GitCommand INIT = write("init");