Skip to content

Commit c5da068

Browse files
committed
Add more debug statements
1 parent cc005ee commit c5da068

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/appimagetool.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,16 @@ main (int argc, char *argv[])
581581
// to get a proper error message, we now fetch the message via the returned exit code
582582
// the call returns false if the call failed, and this is what we expect to have happened
583583
// hence we can assume that there must be an error in GLib if it returned true
584-
g_spawn_check_exit_status(exit_status, &error);
584+
if (g_spawn_check_exit_status(exit_status, &error)) {
585+
g_printerr("Failed to run 'git rev-parse --short HEAD, but GLib says the process didn't exit abnormally");
586+
}
587+
}
588+
589+
if (error == NULL) {
590+
g_printerr("Failed to run 'git rev-parse --short HEAD, but failed to interpret GLib error state: %d\n", exit_status);
591+
} else {
592+
g_printerr("Failed to run 'git rev-parse --short HEAD: %s (code %d)\n", error->message, error->code);
585593
}
586-
g_printerr("Failed to run 'git rev-parse --short HEAD: %s (code %d)\n", error->message, error->code);
587594
} else {
588595
version_env = g_strstrip(out);
589596

0 commit comments

Comments
 (0)