gitg killed my stash
- From: Guilhem BONNEFILLE <guilhem bonnefille gmail com>
- To: gitg-list gnome org
- Subject: gitg killed my stash
- Date: Tue, 28 Jul 2009 22:30:32 +0200
Hi,
I don't know how to report this issue, so I send it to the list.
I don't know what precisely occured.
With 0.0.4, I deleted a stash from the middle of history, not from the
upper part of the list. gitg crashes. But, while crashing, it
overwrite .git/refs/stash with a single line containing a 00..00 SHA-1.
I really don't knwo what occured, so no idea how to fix this.
Note that in this situation, gitg is unable to run: git is unable to
parse refs, so gitg gets a zero length list of refs in load_refs, and
so... segfault.
A minor improve can be to apply the following patch:
diff --git a/gitg/gitg-repository.c b/gitg/gitg-repository.c
index 6295871..4f47a37 100644
--- a/gitg/gitg-repository.c
+++ b/gitg/gitg-repository.c
@@ -1099,7 +1099,7 @@ load_refs(GitgRepository *self)
gchar **buffer = refs;
gchar *buf;
- while ((buf = *buffer++) != NULL)
+ while (buffer != NULL && (buf = *buffer++) != NULL)
{
// each line will look like <name> <hash>
gchar **components = g_strsplit(buf, " ", 3);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]