From f5b720e417bd75f51323da7ae58f0fe373c2ee0a Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Fri, 30 Mar 2012 13:31:32 +0400 Subject: [PATCH] GitCommand: fetch and show are read-commands show is obviously a reading command fetch doesn't modify the index, so it is a read-command, since avoiding conflicts around the index.lock is the purpose of the locking policy. push is also a read-command, but let it be "write" as an additional protection against "commit during push" problem, when a commit may be unintentionally pushed. --- plugins/git4idea/src/git4idea/commands/GitCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/commands/GitCommand.java b/plugins/git4idea/src/git4idea/commands/GitCommand.java index 69ad8a8445fa..cccf4ef8b14b 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 CHERRY_PICK = write("cherry-pick"); public static final GitCommand CLONE = write("clone"); public static final GitCommand DIFF = read("diff"); - public static final GitCommand FETCH = write("fetch"); + 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"); public static final GitCommand LOG = read("log"); public static final GitCommand LS_FILES = read("ls-files"); @@ -57,7 +57,7 @@ public class GitCommand { public static final GitCommand RESET = write("reset"); public static final GitCommand REV_LIST = read("rev-list"); public static final GitCommand RM = write("rm"); - public static final GitCommand SHOW = write("show"); + public static final GitCommand SHOW = read("show"); public static final GitCommand STASH = write("stash"); public static final GitCommand STATUS = read("status"); public static final GitCommand TAG = read("tag");