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.
This commit is contained in:
Kirill Likhodedov
2017-10-10 22:43:48 +03:00
parent b0c5990f0a
commit b5682c764a
@@ -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");