Browse Source

Fix two nits about DirCacheEntry constructors

Explicitly pass STAGE_0 when creating a DirCacheEntry from String.
This matches the immediate next constructor that accepts the int
stage argument better, making the code easier to read.

Fix a weird line break where the comma was orphaned by itself.

Change-Id: Icf0970dd02a63877f9e41b51b982b0265e8b8887
tags/v3.4.2.201412180340-r
Shawn Pearce 9 years ago
parent
commit
98c75a7ca2

+ 4
- 4
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java View File



if (mightBeRacilyClean(smudge_s, smudge_ns)) if (mightBeRacilyClean(smudge_s, smudge_ns))
smudgeRacilyClean(); smudgeRacilyClean();

} }


/** /**
* or DirCache file. * or DirCache file.
*/ */
public DirCacheEntry(final String newPath) { public DirCacheEntry(final String newPath) {
this(Constants.encode(newPath));
this(Constants.encode(newPath), STAGE_0);
} }


/** /**
if (!isValidPath(newPath)) if (!isValidPath(newPath))
throw new InvalidPathException(toString(newPath)); throw new InvalidPathException(toString(newPath));
if (stage < 0 || 3 < stage) if (stage < 0 || 3 < stage)
throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidStageForPath
, stage, toString(newPath)));
throw new IllegalArgumentException(MessageFormat.format(
JGitText.get().invalidStageForPath,
stage, toString(newPath)));


info = new byte[INFO_LEN]; info = new byte[INFO_LEN];
infoOffset = 0; infoOffset = 0;

Loading…
Cancel
Save