File tree Expand file tree Collapse file tree
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1317,6 +1317,7 @@ class LooseItems {
13171317 * path of a loose ref relative to the repository root
13181318 */
13191319 void refreshPathToLooseRef (Path refPath ) {
1320+ boolean failed = false ;
13201321 for (int i = 1 ; i < refPath .getNameCount (); i ++) {
13211322 File dir = fileFor (refPath .subpath (0 , i ).toString ());
13221323 // Use Files.newInputStream(Path) as it is consistent with other
@@ -1325,7 +1326,16 @@ void refreshPathToLooseRef(Path refPath) {
13251326 try (InputStream stream = Files .newInputStream (dir .toPath ())) {
13261327 // open the dir to refresh attributes (on some NFS clients)
13271328 } catch (IOException e ) {
1328- break ; // loose ref may not exist
1329+ failed = true ;
1330+ break ; // directory may not exist
1331+ }
1332+ }
1333+ if (!failed ) {
1334+ try (InputStream stream = Files .newInputStream (refPath )) {
1335+ // open the loose ref to refresh attributes (on some NFS
1336+ // clients)
1337+ } catch (IOException e ) {
1338+ // loose ref may not exist
13291339 }
13301340 }
13311341 }
You can’t perform that action at this time.
0 commit comments