Skip to content

Instantly share code, notes, and snippets.

Created February 27, 2010 21:18
Show Gist options
  • Save anonymous/316958 to your computer and use it in GitHub Desktop.
Save anonymous/316958 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from dulwich.repo import Repo
import sys
repo = Repo('.')
have = []
want = []
for arg in sys.argv[1:]:
if arg[0] == '^':
assert len(arg) == 41
have.append(arg[1:])
else:
assert len(arg) == 40
want.append(arg)
for sha, path in repo.object_store.find_missing_objects(have, want):
print sha, path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment