NPE for git log when no tracked branch is specified

This commit is contained in:
irengrig
2011-09-20 15:25:41 +04:00
parent 8aa499208c
commit d2656029c5
@@ -120,8 +120,8 @@ public class LowLevelAccessImpl implements LowLevelAccess {
refs.setCurrent(current);
if (current != null) {
GitBranch tracked = current.tracked(myProject, myRoot);
String fullName = tracked.getFullName();
fullName = fullName.startsWith(GitBranch.REFS_REMOTES_PREFIX) ? fullName.substring(GitBranch.REFS_REMOTES_PREFIX.length()) : fullName;
String fullName = tracked == null ? null : tracked.getFullName();
fullName = fullName != null && fullName.startsWith(GitBranch.REFS_REMOTES_PREFIX) ? fullName.substring(GitBranch.REFS_REMOTES_PREFIX.length()) : fullName;
refs.setTrackedRemote(fullName);
}
refs.setUsername(GitConfigUtil.getValue(myProject, myRoot, GitConfigUtil.USER_NAME));