summaryrefslogtreecommitdiff
path: root/lib/git
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git')
-rw-r--r--lib/git/index.py7
-rw-r--r--lib/git/repo.py3
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/git/index.py b/lib/git/index.py
index df633ccd..96d42eaf 100644
--- a/lib/git/index.py
+++ b/lib/git/index.py
@@ -672,7 +672,7 @@ class IndexFile(LazyMixin, diff.Diffable):
Returns
Iterator yielding dict(path : list( tuple( stage, Blob, ...))), being
a dictionary associating a path in the index with a list containing
- stage/blob pairs
+ sorted stage/blob pairs
Note:
Blobs that have been removed in one side simply do not exist in the
@@ -684,7 +684,8 @@ class IndexFile(LazyMixin, diff.Diffable):
for stage, blob in self.iter_blobs(is_unmerged_blob):
path_map.setdefault(blob.path, list()).append((stage, blob))
# END for each unmerged blob
-
+ for l in path_map.itervalues():
+ l.sort()
return path_map
@classmethod
@@ -724,7 +725,7 @@ class IndexFile(LazyMixin, diff.Diffable):
for blob in iter_blobs:
stage_null_key = (blob.path, 0)
if stage_null_key in self.entries:
- raise ValueError( "Blob %r already at stage 0" % blob )
+ raise ValueError( "Path %r already exists at stage 0" % blob.path )
# END assert blob is not stage 0 already
# delete all possible stages
diff --git a/lib/git/repo.py b/lib/git/repo.py
index 25cc412e..0c8ac9e9 100644
--- a/lib/git/repo.py
+++ b/lib/git/repo.py
@@ -693,8 +693,9 @@ class Repo(object):
if mkdir and path and not os.path.exists(path):
os.makedirs(path, 0755)
+ # git command automatically chdir into the directory
git = Git(path)
- output = git.init(path, **kwargs)
+ output = git.init(**kwargs)
return Repo(path)
def clone(self, path, **kwargs):