コード例 #1
0
ファイル: worktree.py プロジェクト: strboul/git-substatus
 def __has_worktree(self, path: str) -> bool:
     list_worktrees: str = run_git_command(path, ["worktree", "list"])
     worktrees_lst: List[str] = list_worktrees.split("\n")
     worktrees_lst = list(filter(None, worktrees_lst))
     if len(worktrees_lst) > 1:
         return True
     return False
コード例 #2
0
ファイル: stash.py プロジェクト: strboul/git-substatus
 def __get_num_stash(self, path) -> str:
     cmd = run_git_command(
         path,
         ["rev-list", "--walk-reflogs", "--count", "refs/stash"]
     )
     out = cmd.replace("\n", "")
     return out
コード例 #3
0
ファイル: fetch.py プロジェクト: beucismis/git-substatus
 def __do_git_fetch(self, path) -> bool:
     repo_name = os.path.basename(path)
     print(f"Fetching from remote \"{repo_name}\"")
     run_git_command(path, ["fetch"])
     return True
コード例 #4
0
ファイル: repository.py プロジェクト: strboul/git-substatus
 def __is_git_repository(self, path: str) -> bool:
     cmd = run_git_command(path, ["rev-parse", "--show-toplevel"])
     cmd = "".join(cmd.split())
     base_cmd = os.path.basename(cmd)
     base_path = os.path.basename(path)
     return bool(True if base_cmd == base_path else False)
コード例 #5
0
 def __get_details_text(cls) -> str:
     cmd = run_git_command(cls.path, ["status", "-sb"])
     return cmd
コード例 #6
0
 def __current_branch_name(self, path: str) -> str:
     cmd = run_git_command(path, ["symbolic-ref", "--short", "HEAD"])
     out = cmd.replace("\n", "")
     return out