|
@@ -508,10 +508,12 @@ def build_index_from_tree(root_path, index_path, object_store, tree_id,
|
|
if not os.path.exists(os.path.dirname(full_path)):
|
|
if not os.path.exists(os.path.dirname(full_path)):
|
|
os.makedirs(os.path.dirname(full_path))
|
|
os.makedirs(os.path.dirname(full_path))
|
|
|
|
|
|
- # FIXME: Merge new index into working tree
|
|
|
|
|
|
+ # TODO(jelmer): Merge new index into working tree
|
|
if S_ISGITLINK(entry.mode):
|
|
if S_ISGITLINK(entry.mode):
|
|
- os.mkdir(full_path)
|
|
|
|
|
|
+ if not os.path.isdir(full_path):
|
|
|
|
+ os.mkdir(full_path)
|
|
st = os.lstat(full_path)
|
|
st = os.lstat(full_path)
|
|
|
|
+ # TODO(jelmer): record and return submodule paths
|
|
else:
|
|
else:
|
|
obj = object_store[entry.sha]
|
|
obj = object_store[entry.sha]
|
|
st = build_file_from_blob(obj, entry.mode, full_path,
|
|
st = build_file_from_blob(obj, entry.mode, full_path,
|
|
@@ -560,6 +562,7 @@ def get_unstaged_changes(index, root_path):
|
|
|
|
|
|
for tree_path, entry in index.iteritems():
|
|
for tree_path, entry in index.iteritems():
|
|
full_path = _tree_to_fs_path(root_path, tree_path)
|
|
full_path = _tree_to_fs_path(root_path, tree_path)
|
|
|
|
+ # TODO(jelmer): handle S_ISGITLINK(entry.mode) here
|
|
try:
|
|
try:
|
|
blob = blob_from_path_and_stat(full_path, os.lstat(full_path))
|
|
blob = blob_from_path_and_stat(full_path, os.lstat(full_path))
|
|
except OSError as e:
|
|
except OSError as e:
|
|
@@ -568,6 +571,11 @@ def get_unstaged_changes(index, root_path):
|
|
# The file was removed, so we assume that counts as
|
|
# The file was removed, so we assume that counts as
|
|
# different from whatever file used to exist.
|
|
# different from whatever file used to exist.
|
|
yield tree_path
|
|
yield tree_path
|
|
|
|
+ except IOError as e:
|
|
|
|
+ if e.errno != errno.EISDIR:
|
|
|
|
+ raise
|
|
|
|
+ # The file was changed to a directory, so consider it removed.
|
|
|
|
+ yield tree_path
|
|
else:
|
|
else:
|
|
if blob.id != entry.sha:
|
|
if blob.id != entry.sha:
|
|
yield tree_path
|
|
yield tree_path
|