mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 02:12:17 +02:00
filter-repo: add counting of objects, as well as commits
Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
parent
3d10238a47
commit
7371f8e3e4
@ -363,3 +363,9 @@ def get_total_commits(repo):
|
||||
p1 = Popen(["git", "rev-list", "--all"], stdout = PIPE, cwd = repo)
|
||||
p2 = Popen(["wc", "-l"], stdin = p1.stdout, stdout = PIPE)
|
||||
return int(p2.communicate()[0])
|
||||
|
||||
def get_total_objects(repo):
|
||||
p1 = Popen(["git", "count-objects", "-v"], stdout = PIPE, cwd = repo)
|
||||
lines = p1.stdout.read().splitlines()
|
||||
# Return unpacked objects + packed-objects
|
||||
return int(lines[0].split()[1]) + int(lines[2].split()[1])
|
||||
|
Loading…
Reference in New Issue
Block a user