Re: gitg killed my stash



See:

http://bugzilla.gnome.org/show_bug.cgi?id=589594


Jesse

Guilhem BONNEFILLE wrote:
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);


_______________________________________________
gitg-list mailing list
gitg-list gnome org
http://mail.gnome.org/mailman/listinfo/gitg-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]