Last active
December 13, 2015 19:28
-
-
Save abondis/4962393 to your computer and use it in GitHub Desktop.
dulwich: move a file in a 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
from dulwich.repo import Repo | |
r = Repo('/tmp/bunchofrepos/montestgit/') | |
t = r['HEAD'].tree | |
T = r.tree(t) | |
truc_entry = T.lookup_path(r.get_object, 'blah/truc') | |
truc_tree = r.tree(truc_entry[1]) | |
truc_tree.entries() | |
truc_tree['new_filename.txt'] = truc_tree['bidule.text'] | |
truc_tree.entries() | |
del truc_tree['bidule.text'] | |
truc_tree.entries() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment