lib/heirloom/archive/builder.rb in heirloom-0.3.0 vs lib/heirloom/archive/builder.rb in heirloom-0.3.1

- old
+ new

@@ -20,11 +20,11 @@ directory = Directory.new :path => source, :exclude => args[:exclude], :config => config - directory.build_artifact_from_directory + return false unless directory.build_artifact_from_directory self.local_build = directory.local_build create_artifact_record @@ -41,11 +41,16 @@ end private def add_git_commit - git_commit = GitDirectory.new(:path => source).commit - add_git_commit_to_artifact_record git_commit + git = GitDirectory.new(:path => source) + commit = git.commit id + if commit + add_git_commit_to_artifact_record commit + else + logger.warn "Could not find Git sha: #{id}." + end end def add_git_commit_to_artifact_record(commit) attributes = { 'sha' => id, 'abbreviated_sha' => commit.id_abbrev,