amalgame/commit

Make sure getting a named graph's prov revision stamp does not fail when source graph has dissappeared

authorJacco van Ossenbruggen
Mon Dec 22 14:17:57 2014 +0100
committerJacco van Ossenbruggen
Mon Dec 22 14:17:57 2014 +0100
commit9d19d8ea187a175a1a02b6c3276a77a876f90c25
tree7e75b9e2f16c7477f68369bb43342fd38ed0c4d8
parent1f326eff2cfc8a2fe0792a67a2952bcee6e79f09
Diff style: patch stat
diff --git a/lib/amalgame/ag_provenance.pl b/lib/amalgame/ag_provenance.pl
index 60f991a..8e9d799 100644
--- a/lib/amalgame/ag_provenance.pl
+++ b/lib/amalgame/ag_provenance.pl
@@ -374,8 +374,11 @@ prov_get_entity_version(Entity, SourceGraph, Version) :-
 	rdf_graph_property(SourceGraph, source(SourceFileURL)),
 	uri_file_name(SourceFileURL, Filename),
 	file_directory_name(Filename, Dirname),
-	register_git_module(Entity, [directory(Dirname), home_url(Entity)]),
-	(   git_module_property(Entity, version(GitVersion))
+	(   catch(register_git_module(Entity, [directory(Dirname), home_url(Entity)]),Error,
+              ( print_message(error, Error),
+                fail
+              )),
+	    git_module_property(Entity, version(GitVersion))
 	->  format(atom(Version),  'GIT version: ~w', [GitVersion])
 	;   rdf_graph_property(SourceGraph, hash(Hash)),
 	    rdf_graph_property(SourceGraph, source_last_modified(LastModified)),