-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
527 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package gitflow; | ||
|
||
import com.intellij.openapi.project.Project; | ||
import git4idea.GitUtil; | ||
import git4idea.repo.GitRepository; | ||
import gitflow.actions.GitflowActions; | ||
|
||
import java.util.HashMap; | ||
import java.util.Iterator; | ||
import java.util.List; | ||
|
||
/** | ||
* This class maps repos to their corresponding branch utils | ||
*/ | ||
public class GitflowBranchUtilManager { | ||
private static HashMap<GitRepository, GitflowBranchUtil> repoBranchUtilMap; | ||
|
||
static public GitflowBranchUtil getBranchUtil(GitRepository repo){ | ||
return repoBranchUtilMap.get(repo); | ||
} | ||
|
||
static public void setupBranchUtil(Project project, GitRepository repo){ | ||
GitflowBranchUtil gitflowBranchUtil = new GitflowBranchUtil(project, repo); | ||
repoBranchUtilMap.put(repo, gitflowBranchUtil); | ||
} | ||
|
||
/** | ||
* Repopulates the branchUtils for each repo | ||
* @param project | ||
*/ | ||
static public void update(Project project){ | ||
if (repoBranchUtilMap == null){ | ||
repoBranchUtilMap = new HashMap<GitRepository, GitflowBranchUtil>(); | ||
} | ||
repoBranchUtilMap.clear(); | ||
|
||
List<GitRepository> gitRepositories = GitUtil.getRepositoryManager(project).getRepositories(); | ||
|
||
Iterator gitRepositoriesIterator = gitRepositories.iterator(); | ||
while(gitRepositoriesIterator.hasNext()){ | ||
GitRepository repo = (GitRepository) gitRepositoriesIterator.next(); | ||
GitflowBranchUtilManager.setupBranchUtil(project, repo); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.