1 /*
2 * Copyright (C) 2008-2009, Google Inc. and others
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Distribution License v. 1.0 which is available at
6 * https://www.eclipse.org/org/documents/edl-v10.php.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10
11 package org.eclipse.jgit.errors;
12
13 import java.io.IOException;
14 import java.text.MessageFormat;
15
16 import org.eclipse.jgit.dircache.DirCacheEntry;
17 import org.eclipse.jgit.internal.JGitText;
18
19 /**
20 * Indicates one or more paths in a DirCache have non-zero stages present.
21 */
22 public class UnmergedPathException extends IOException {
23 private static final long serialVersionUID = 1L;
24
25 private final DirCacheEntry entry;
26
27 /**
28 * Create a new unmerged path exception.
29 *
30 * @param dce
31 * the first non-zero stage of the unmerged path.
32 */
33 public UnmergedPathException(DirCacheEntry dce) {
34 super(MessageFormat.format(JGitText.get().unmergedPath, dce.getPathString()));
35 entry = dce;
36 }
37
38 /**
39 * Get the first non-zero stage of the unmerged path
40 *
41 * @return the first non-zero stage of the unmerged path
42 */
43 public DirCacheEntry getDirCacheEntry() {
44 return entry;
45 }
46 }