[gitg/gnome-3-20] Avoid submodule iteration on bare repositories due to libgit2 bug
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/gnome-3-20] Avoid submodule iteration on bare repositories due to libgit2 bug
- Date: Thu, 25 Aug 2016 14:54:14 +0000 (UTC)
commit 8d8a1f9f6c7301081f3e4f6078f1dbf0723aa2a9
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Thu Aug 18 11:04:31 2016 +0200
Avoid submodule iteration on bare repositories due to libgit2 bug
libgitg/gitg-stage-status-enumerator.vala | 31 ++++++++++++++++------------
1 files changed, 18 insertions(+), 13 deletions(-)
---
diff --git a/libgitg/gitg-stage-status-enumerator.vala b/libgitg/gitg-stage-status-enumerator.vala
index 147474b..58290b8 100644
--- a/libgitg/gitg-stage-status-enumerator.vala
+++ b/libgitg/gitg-stage-status-enumerator.vala
@@ -292,22 +292,27 @@ public class StageStatusEnumerator : Object
var submodule_paths = new Gee.HashSet<string>();
- try
+ // Due to a bug in libgit2, submodule iteration crashes when performed
+ // on a bare repository
+ if (!d_repository.is_bare)
{
- d_repository.submodule_foreach((submodule, name) => {
- submodule_paths.add(submodule.get_path());
+ try
+ {
+ d_repository.submodule_foreach((submodule, name) => {
+ submodule_paths.add(submodule.get_path());
- if (!d_ignored_submodules.contains(name))
- {
- try
+ if (!d_ignored_submodules.contains(name))
{
- add(new
StageStatusSubmodule(d_repository.lookup_submodule(name)));
- } catch {}
- }
-
- return d_cancellable.is_cancelled() ? 1 : 0;
- });
- } catch {}
+ try
+ {
+ add(new
StageStatusSubmodule(d_repository.lookup_submodule(name)));
+ } catch {}
+ }
+
+ return d_cancellable.is_cancelled() ? 1 : 0;
+ });
+ } catch {}
+ }
try
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]