[gitg/wip/submodules] Ignore status files which are submodules
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/submodules] Ignore status files which are submodules
- Date: Sun, 14 Dec 2014 11:08:49 +0000 (UTC)
commit 3d842e99ccdcfea4f75282a66e9fb62b5f098f8b
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sun Dec 14 12:01:16 2014 +0100
Ignore status files which are submodules
libgitg/gitg-stage-status-enumerator.vala | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/libgitg/gitg-stage-status-enumerator.vala b/libgitg/gitg-stage-status-enumerator.vala
index 90b5e4f..7cd9b64 100644
--- a/libgitg/gitg-stage-status-enumerator.vala
+++ b/libgitg/gitg-stage-status-enumerator.vala
@@ -258,10 +258,15 @@ public class StageStatusEnumerator : Object
}
};
+ var submodule_paths = new Gee.HashSet<string>();
+
try
{
- d_repository.file_status_foreach(d_options, (path, flags) => {
- add(new StageStatusFile(path, flags));
+ d_repository.submodule_foreach((submodule) => {
+ submodule.set_ignore(Ggit.SubmoduleIgnore.UNTRACKED);
+ submodule_paths.add(submodule.get_path());
+
+ add(new StageStatusSubmodule(submodule));
return d_cancellable.is_cancelled() ? 1 : 0;
});
@@ -269,9 +274,11 @@ public class StageStatusEnumerator : Object
try
{
- d_repository.submodule_foreach((submodule) => {
- submodule.set_ignore(Ggit.SubmoduleIgnore.UNTRACKED);
- add(new StageStatusSubmodule(submodule));
+ d_repository.file_status_foreach(d_options, (path, flags) => {
+ if (!submodule_paths.contains(path))
+ {
+ add(new StageStatusFile(path, flags));
+ }
return d_cancellable.is_cancelled() ? 1 : 0;
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]