Remote can be empty, so on save the strcmp SIGSEGVs.

Introduced in commit 7cf3ebc2f7b6.

Patch attached.

best,

--jan


>From bf519848a21bb1eb23204e7efd06c4f07d097a7d Mon Sep 17 00:00:00 2001
From: Jan Mulder <[email protected]>
Date: Thu, 18 Jun 2015 16:08:54 +0200
Subject: [PATCH] [PATCH] Do not abort on empty remote

Do not abort on empty remote.

Signed-off-by: Jan Mulder <[email protected]>
---
 save-git.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/save-git.c b/save-git.c
index 3f540ea..e0959cd 100644
--- a/save-git.c
+++ b/save-git.c
@@ -1052,7 +1052,7 @@ static int create_new_commit(git_repository *repo, const char *remote, const cha
 			const git_oid *id = git_commit_id((const git_commit *) parent);
 			/* if we are saving to the same git tree we got this from, let's make
 			 * sure there is no confusion */
-			if (!strcmp(existing_filename, remote) && git_oid_strcmp(id, saved_git_id))
+			if (remote && !strcmp(existing_filename, remote) && git_oid_strcmp(id, saved_git_id))
 				return report_error("The git branch does not match the git parent of the source");
 		}
 
-- 
2.4.4

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to