Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
43,900
JComponent () { return myTextEditor.getEditorField().getFocusTarget(); }
getPreferredFocusedComponent
43,901
String () { return myTextEditor.getComment(); }
getText
43,902
void () { LocalFileSystem.getInstance().removeWatchedRoots(myWatchRequests); }
dispose
43,903
void (@NotNull List<? extends @NotNull VFileEvent> events) { GitLocalBranch currentBranch = myRepository.getCurrentBranch(); // which files in .git were changed boolean configChanged = false; boolean indexChanged = false; boolean headChanged = false; boolean headMoved = false; boolean branchFileChanged = false; boolean...
filesChanged
43,904
boolean (@NotNull VFileEvent event) { VirtualFile file = event.getFile(); if (file == null) return true; // can't do fast check, fallback to paths matching for (VirtualFile dir : myRootDirs) { if (VfsUtilCore.isAncestor(dir, file, false)) return true; } return false; }
isRootDirChange
43,905
void () { for (VirtualFile rootDir : myRepositoryFiles.getRootDirs()) { rootDir.getChildren(); } for (String path : myRepositoryFiles.getPathsToWatch()) { DvcsUtil.ensureAllChildrenInVfs(LocalFileSystem.getInstance().refreshAndFindFileByPath(path)); } }
visitSubDirsInVfs
43,906
boolean (@NotNull Map<String, Hash> resolved, @NotNull String refName, @NotNull Object newValue) { if (resolved.containsKey(refName)) { LOG.error("Duplicate entry for [" + refName + "]. resolved: [" + resolved.get(refName).asString() + "], current: " + newValue + "]"); return true; } return false; }
duplicateEntry
43,907
VirtualFile () { return myRoot; }
getRoot
43,908
FilePath () { return myFilePath; }
getFilePath
43,909
Status (@NotNull ConflictSide side) { return getStatus(side, false); }
getStatus
43,910
Status (@NotNull ConflictSide side, boolean isReversed) { if (side == ConflictSide.OURS) { return !isReversed ? myOurStatus : myTheirStatus; } else { return !isReversed ? myTheirStatus : myOurStatus; } }
getStatus
43,911
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GitConflict conflict = (GitConflict)o; return myRoot.equals(conflict.myRoot) && myFilePath.equals(conflict.myFilePath) && myOurStatus == conflict.myOurStatus && myTheirStatus == conflict.myTheirStatus; }
equals
43,912
int () { return Objects.hash(myRoot, myFilePath, myOurStatus, myTheirStatus); }
hashCode
43,913
GitRepositoryManager (@NotNull Project project) { return project.getService(GitRepositoryManager.class); }
getInstance
43,914
boolean () { return GitVcsSettings.getInstance(getVcs().getProject()).getSyncSetting() == DvcsSyncSettings.Value.SYNC && !MultiRootBranches.diverged(getRepositories()); }
isSyncEnabled
43,915
List<GitRepository> () { return getRepositories(GitRepository.class); }
getRepositories
43,916
boolean () { return !thereAreSubmodulesInProject() && super.shouldProposeSyncControl(); }
shouldProposeSyncControl
43,917
boolean () { return getRepositories().stream().anyMatch(repo -> !repo.getSubmodules().isEmpty()); }
thereAreSubmodulesInProject
43,918
boolean () { return getOngoingRebaseSpec() != null; }
hasOngoingRebase
43,919
void (@Nullable GitRebaseSpec ongoingRebaseSpec) { myOngoingRebaseSpec = ongoingRebaseSpec != null && ongoingRebaseSpec.isValid() ? ongoingRebaseSpec : null; }
setOngoingRebaseSpec
43,920
List<GitRepository> (@NotNull Collection<? extends GitRepository> repositories) { return ContainerUtil.sorted(repositories, DEPENDENCY_COMPARATOR); }
sortByDependency
43,921
GitRepository (@NotNull VirtualFile root, @NotNull Project project, boolean listenToRepoChanges) { GitRepository repository = GitRepositoryManager.getInstance(project).getRepositoryForRoot(root); return notNull(repository, () -> createInstance(root, project, GitDisposable.getInstance(project))); }
getInstance
43,922
GitRepository (@NotNull VirtualFile root, @NotNull Project project, @NotNull Disposable parentDisposable, boolean listenToRepoChanges) { return createInstance(root, project, parentDisposable); }
createInstance
43,923
GitRepository (@NotNull VirtualFile root, @NotNull Project project, @NotNull Disposable parentDisposable) { VirtualFile gitDir = Objects.requireNonNull(GitUtil.findGitDir(root)); return createInstance(root, gitDir, project, parentDisposable); }
createInstance
43,924
GitRepository (@NotNull VirtualFile root, @NotNull VirtualFile gitDir, @NotNull Project project, @NotNull Disposable parentDisposable) { ProgressManager.checkCanceled(); GitRepositoryImpl repository = new GitRepositoryImpl(root, gitDir, project, parentDisposable); repository.setupUpdater(); GitRepositoryManager.getInst...
createInstance
43,925
void () { GitRepositoryUpdater updater = new GitRepositoryUpdater(this, myRepositoryFiles); Disposer.register(this, updater); }
setupUpdater
43,926
VirtualFile () { return myGitDir; }
getGitDir
43,927
GitRepositoryFiles () { return myRepositoryFiles; }
getRepositoryFiles
43,928
GitStagingAreaHolder () { return myStagingAreaHolder; }
getStagingAreaHolder
43,929
GitUntrackedFilesHolder () { return myUntrackedFilesHolder; }
getUntrackedFilesHolder
43,930
GitRepositoryIgnoredFilesHolder () { return myIgnoredRepositoryFilesHolder; }
getIgnoredFilesHolder
43,931
GitRepoInfo () { return myInfo; }
getInfo
43,932
State () { return myInfo.getState(); }
getState
43,933
GitVcs () { return myVcs; }
getVcs
43,934
Collection<GitSubmoduleInfo> () { return myInfo.getSubmodules(); }
getSubmodules
43,935
GitBranchesCollection () { GitRepoInfo info = myInfo; return new GitBranchesCollection(info.getLocalBranchesWithHashes(), info.getRemoteBranchesWithHashes(), myRecentCheckoutBranches); }
getBranches
43,936
Collection<GitRemote> () { return myInfo.getRemotes(); }
getRemotes
43,937
Collection<GitBranchTrackInfo> () { return myInfo.getBranchTrackInfos(); }
getBranchTrackInfos
43,938
boolean () { return getState() == State.REBASING; }
isRebaseInProgress
43,939
boolean () { return getState() != State.DETACHED && getState() != State.REBASING; }
isOnBranch
43,940
void () { ApplicationManager.getApplication().assertIsNonDispatchThread(); GitRepoInfo previousInfo = myInfo; myInfo = readRepoInfo(); notifyIfRepoChanged(this, previousInfo, myInfo); }
update
43,941
GitRepoInfo () { return computeWithSpan(TelemetryManager.getInstance().getTracer(VcsScopeKt.VcsScope), GitTelemetrySpan.Repository.ReadGitRepositoryInfo.getName(), span -> { span.setAttribute("repository", getShortRepositoryName(this)); File configFile = myRepositoryFiles.getConfigFile(); GitConfig config = GitConfig.r...
readRepoInfo
43,942
File () { return new File(VfsUtilCore.virtualToIoFile(getRoot()), ".gitmodules"); }
getSubmoduleFile
43,943
void (@NotNull GitRepository repository, @NotNull GitRepoInfo previousInfo, @NotNull GitRepoInfo info) { Project project = repository.getProject(); if (!project.isDisposed() && !info.equals(previousInfo)) { GitRepositoryManager.getInstance(project).notifyListenersAsync(repository); } }
notifyIfRepoChanged
43,944
String () { return "GitRepository " + getRoot() + " : " + myInfo; }
toLogString
43,945
VcsKey () { return GitVcs.getKey(); }
getSupportedVcs
43,946
void (@NotNull Project project, @NotNull VirtualFile root, boolean addFilesToVcs) { ProgressManager.progress2(GitBundle.message("progress.title.creating.git.repository")); GitCommandResult result = Git.getInstance().init(project, root); if (!result.success()) { VcsNotifier.getInstance(project).notifyError(INIT_FAILED, ...
initRepository
43,947
List<String> () { return myUrls; }
getUrls
43,948
Collection<String> () { return myPushUrls; }
getPushUrls
43,949
List<String> () { return myFetchRefSpecs; }
getFetchRefSpecs
43,950
List<String> () { return myPushRefSpecs; }
getPushRefSpecs
43,951
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GitRemote gitRemote = (GitRemote)o; return myName.equals(gitRemote.myName); // other parameters don't count: remotes are equal if their names are equal // TODO: LOG.warn if other parameters differ }
equals
43,952
int () { return myName.hashCode(); }
hashCode
43,953
int (@NotNull GitRemote o) { return getName().compareTo(o.getName()); }
compareTo
43,954
void () { LOG.debug("Logging .git/refs files. " + ".git/refs/heads " + (myRefsHeadsDir.exists() ? "exists" : "doesn't exist") + ".git/refs/remotes " + (myRefsRemotesDir.exists() ? "exists" : "doesn't exist")); if (LOG.isDebugEnabled()) { logDebugAllFilesIn(myRefsHeadsDir); logDebugAllFilesIn(myRefsRemotesDir); if (myPa...
logDebugAllRefsFiles
43,955
void (@NotNull File dir) { List<String> paths = new ArrayList<>(); FileUtil.processFilesRecursively(dir, (file) -> { if (!file.isDirectory()) paths.add(FileUtil.getRelativePath(dir, file)); return true; }); LOG.debug("Files in " + dir + ": " + paths); }
logDebugAllFilesIn
43,956
boolean (@NotNull File file) { return file.exists() && file.canExecute(); }
isExistingExecutableFile
43,957
boolean () { return myGitFiles.getMergeHeadFile().exists(); }
isMergeInProgress
43,958
boolean () { return myGitFiles.getRebaseApplyDir().exists() || myGitFiles.getRebaseMergeDir().exists(); }
isRebaseInProgress
43,959
boolean () { return myGitFiles.getCherryPickHead().exists(); }
isCherryPickInProgress
43,960
boolean () { return myGitFiles.getRevertHead().exists(); }
isRevertInProgress
43,961
boolean (@NotNull File file) { return file.getName().startsWith("."); }
isHidden
43,962
GitRemoteBranch (@NotNull String fullBranchName, @NotNull Collection<GitRemote> remotes) { String stdName = GitBranchUtil.stripRefsPrefix(fullBranchName); int slash = stdName.indexOf('/'); if (slash == -1) { // .git/refs/remotes/my_branch => git-svn return new GitSvnRemoteBranch(fullBranchName); } else { GitRemote remo...
parseRemoteBranch
43,963
HeadInfo () { String headContent; try { headContent = DvcsUtil.tryLoadFile(myHeadFile, CharsetToolkit.UTF8); } catch (RepoStateException e) { LOG.warn(e); return new HeadInfo(false, null); } Hash hash = parseHash(headContent); if (hash != null) { return new HeadInfo(false, headContent); } String target = getTarget(head...
readHead
43,964
GitLocalBranch () { return myLocalBranch; }
getLocalBranch
43,965
GitRemote () { return myRemoteBranch.getRemote(); }
getRemote
43,966
GitRemoteBranch () { return myRemoteBranch; }
getRemoteBranch
43,967
String () { return String.format("%s->%s", myLocalBranch.getName(), myRemoteBranch.getName()); }
toString
43,968
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GitBranchTrackInfo that = (GitBranchTrackInfo)o; if (myMerge != that.myMerge) return false; if (myLocalBranch != null ? !myLocalBranch.equals(that.myLocalBranch) : that.myLocalBranch != null) return false; if (my...
equals
43,969
int () { int result = myLocalBranch != null ? myLocalBranch.hashCode() : 0; result = 31 * result + (myRemoteBranch != null ? myRemoteBranch.hashCode() : 0); result = 31 * result + (myMerge ? 1 : 0); return result; }
hashCode
43,970
GitRemote (@NotNull Collection<? extends Url> urls, @NotNull Remote remote) { UrlsAndPushUrls substitutedUrls = substituteUrls(urls, remote); return new GitRemote(remote.myName, substitutedUrls.getUrls(), substitutedUrls.getPushUrls(), remote.getFetchSpecs(), remote.getPushSpec()); }
convertRemoteToGitRemote
43,971
GitConfig (@NotNull File configFile) { GitConfig emptyConfig = new GitConfig(emptyList(), emptyList(), emptyList(), new Core(null)); if (!configFile.exists() || configFile.isDirectory()) { LOG.info("No .git/config file at " + configFile.getPath()); return emptyConfig; } Ini ini; try { ini = GitConfigHelperKt.loadIniFil...
read
43,972
Collection<BranchConfig> (@NotNull Ini ini) { Collection<BranchConfig> configs = new ArrayList<>(); for (Map.Entry<String, Profile.Section> stringSectionEntry : ini.entrySet()) { String sectionName = stringSectionEntry.getKey(); Profile.Section section = stringSectionEntry.getValue(); BranchConfig branchConfig = parseB...
parseTrackedInfos
43,973
UrlsAndPushUrls (@NotNull Collection<? extends Url> urlSections, @NotNull Remote remote) { List<String> urls = new ArrayList<>(remote.getUrls().size()); Collection<String> pushUrls = new ArrayList<>(); // urls are substituted by insteadOf // if there are no pushUrls, we create a pushUrl for pushInsteadOf substitutions ...
substituteUrls
43,974
Collection<String> () { return myPushUrls; }
getPushUrls
43,975
List<String> () { return myUrls; }
getUrls
43,976
String (@NotNull String remoteUrl, @NotNull Url url, @NotNull String insteadOf) { return url.myName + remoteUrl.substring(insteadOf.length()); }
substituteUrl
43,977
Core (@NotNull Ini ini) { String hooksPath = null; List<Profile.Section> sections = ContainerUtil.notNullize(ini.getAll(CORE_SECTION)); for (Profile.Section section : ContainerUtil.reverse(sections)) { // take entry from last section for duplicates if (hooksPath == null) hooksPath = ContainerUtil.getLastItem(section.ge...
parseCore
43,978
Collection<String> () { return myUrls; }
getUrls
43,979
Collection<String> () { return myPushUrls; }
getPushUrls
43,980
List<String> () { return myPushSpec; }
getPushSpec
43,981
List<String> () { return myFetchSpecs; }
getFetchSpecs
43,982
String () { return myName; }
getName
43,983
GitRepositoryFiles (@NotNull VirtualFile rootDir, @NotNull VirtualFile gitDir) { VirtualFile gitDirForWorktree = getMainGitDirForWorktree(gitDir); VirtualFile mainDir = gitDirForWorktree == null ? gitDir : gitDirForWorktree; return new GitRepositoryFiles(rootDir, mainDir, gitDir); }
createInstance
43,984
String (@NotNull String s) { return "/" + s; }
slash
43,985
File () { return file(myHeadFilePath); }
getHeadFile
43,986
File () { return file(myConfigFilePath); }
getConfigFile
43,987
File () { return file(myRebaseMergePath); }
getRebaseMergeDir
43,988
File () { return file(myRebaseApplyPath); }
getRebaseApplyDir
43,989
File () { return file(myMergeHeadPath); }
getMergeHeadFile
43,990
File () { return file(myCherryPickHeadPath); }
getCherryPickHead
43,991
File () { return file(myRevertHeadPath); }
getRevertHead
43,992
File () { return file(myMergeMessagePath); }
getMergeMessageFile
43,993
File () { return file(myMergeSquashPath); }
getSquashMessageFile
43,994
void (@NotNull GitConfig.Core core) { String hooksPath = core.getHooksPath(); if (hooksPath != null) { try { myCustomHooksDirPath = myRootDir.toNioPath().resolve(hooksPath).toString(); } catch (InvalidPathException e) { LOG.warn("Can't resolve custom hooks path: '" + hooksPath + "'"); myCustomHooksDirPath = null; } } e...
updateCustomPaths
43,995
File () { return hook(PRE_COMMIT_HOOK); }
getPreCommitHookFile
43,996
File () { return hook(PRE_PUSH_HOOK); }
getPrePushHookFile
43,997
File () { return hook(COMMIT_MSG_HOOK); }
getCommitMsgHookFile
43,998
File () { return file(myShallow); }
getShallowFile
43,999
File () { return file(myExcludePath); }
getExcludeFile