Code Duplication    Length = 11-12 lines in 2 locations

code/model/jobs/DNDeployment.php 2 locations

@@ 171-182 (lines=12) @@
168
	 *
169
	 * @return \Gitonomy\Git\Commit|null
170
	 */
171
	public function getCommit() {
172
		$repo = $this->getRepository();
173
		if($repo) {
174
			try {
175
				return $this->Environment()->getCommit($this->SHA);
176
			} catch(Gitonomy\Git\Exception\ReferenceNotFoundException $ex) {
177
				return null;
178
			}
179
		}
180
181
		return null;
182
	}
183
184
	/**
185
	 * Get the commit URL to the commit associated with this deployment.
@@ 209-219 (lines=11) @@
206
	 *
207
	 * @return string|null
208
	 */
209
	public function getCommitMessage() {
210
		$commit = $this->getCommit();
211
		if($commit) {
212
			try {
213
				return Convert::raw2xml($this->Environment()->getCommitMessage($commit));
214
			} catch(Gitonomy\Git\Exception\ReferenceNotFoundException $e) {
215
				return null;
216
			}
217
		}
218
		return null;
219
	}
220
221
	/**
222
	 * Return all tags for the deployed commit.