public static void GetAffectedGit(UnityPathSelectionInfo selector, out GitLinkOnDisk gitAffected) { string path = selector.GetAbsolutePath(true); if (QuickGit.IsPathHasGitRootFolder(path)) { gitAffected = new GitLinkOnDisk(path); } QuickGit.GetGitInParents(path, QuickGit.PathReadDirection.LeafToRoot, out gitAffected); }
void OnGUI() { UnityPathSelectionInfo.Get(out m_pathFound, out m_selector); GUILayout.Label("Package.json: " + m_selector.GetRelativePath(false), EditorStyles.boldLabel); PackageJsonFileStream f = PackageJsonUtility.GetPackageFile(m_selector); QuickGit.GetGitInParents(m_selector.GetAbsolutePath(false), QuickGit.PathReadDirection.LeafToRoot, out m_gitLink); DrawEditorDefaultInterface(m_selector, f, ref m_builder, ref m_jsonProposition, ref m_raw, ref m_hide); }
void OnGUI() { UnityPathSelectionInfo.Get(out m_pathFound, out m_selector); GUILayout.Label("Read Me: " + m_selector.GetRelativePath(false), EditorStyles.boldLabel); ReadMeFileStream f = ReadMeUtility.GetReadMeFile(m_selector); QuickGit.GetGitInParents(m_selector.GetAbsolutePath(false), QuickGit.PathReadDirection.LeafToRoot, out m_gitLink); //QuickGit.GetGitInDirectory(m_selector.GetAbsolutePath(false), out m_gitLink, true); DrawEditorDefaultInterface(f, ref m_gitLink, ref m_text, ref m_hide); }
private string GetGitFolderAbsolutPath(out bool hasGitInParent) { string path = ""; hasGitInParent = false; GitLinkOnDisk gd; QuickGit.GetGitInParents(m_absoluteSelection, QuickGit.PathReadDirection.LeafToRoot, out gd); if (gd != null) { hasGitInParent = true; path = gd.GetDirectoryPath(); } return(path); }
void OnGUI() { if (m_info == null) { m_info = new Info(); } bool foundPath = false; string previousPath = m_info.m_directoryRelative; UnityPathSelectionInfo selected; UnityPathSelectionInfo.Get(out foundPath, out selected); m_info.m_directoryRelative = selected.GetRelativePath(true); m_info.m_directoryAbsolute = selected.GetAbsolutePath(true); bool changeFound = m_info.m_directoryRelative != previousPath; bool resquestRefresh = GUILayout.Button("Refresh"); if (resquestRefresh || changeFound) { m_gitInProject.Refresh(); m_info.m_gitLinksPath = QuickGit.GetAllFolders(m_info.m_directoryAbsolute, true); QuickGit.GetGitsInDirectory(m_info.m_directoryAbsolute, out m_info.m_gitLinks); m_info.m_projectGitInParent = ""; GitLinkOnDisk gd; QuickGit.GetGitInParents(selected.GetAbsolutePath(true), QuickGit.PathReadDirection.LeafToRoot, out gd); if (gd != null) { m_info.m_projectGitInParent = gd.GetDirectoryPath(); } } EditorGUILayout.TextField("Relative >", m_info.m_directoryRelative); EditorGUILayout.TextField("Abosluete > ", m_info.m_directoryAbsolute); // if (foundPath) { if (!string.IsNullOrEmpty(m_info.m_projectGitInParent)) { EditorGUILayout.TextField("Parent Git", m_info.m_projectGitInParent.Length <= 0?"Project is not in a git.": m_info.m_projectGitInParent); } m_info.m_displayAllFolder = EditorGUILayout.Toggle("All Directory", m_info.m_displayAllFolder); if (m_info.m_displayAllFolder) { for (int i = 0; i < m_info.m_gitLinksPath.Length; i++) { m_info.m_gitLinksPath[i] = EditorGUILayout.TextField("Directory", m_info.m_gitLinksPath[i]); } } m_info.m_displayAllGitInFolder = EditorGUILayout.Toggle("All Repository", m_info.m_displayAllGitInFolder); if (m_info.m_displayAllGitInFolder) { for (int i = 0; i < m_info.m_gitLinks.Count; i++) { GitEditorDrawer.DisplayGitInfoWithCommand(m_info.m_gitLinks[i], ref m_info.m_displayprojectsInfo[i], ref m_info.m_displayInfoInGits[i]); EditorGUILayout.Space(); } } } GUILayout.BeginHorizontal(); GitEditorDrawer.ButtonDeleteEmptyFiles(m_info.m_directoryAbsolute); GitEditorDrawer.ButtonRefreshGitKeeper(m_info.m_directoryAbsolute); GUILayout.EndHorizontal(); }