Please consider using "--reference-if-able" argument instead of "--reference". Advantage of this method is that it can handle non-existing path situation.
It would be very helpful in situations when for some reason reference repository is not available on build agent so it would continue with remote repo saving build from failure by extending resource usage.
Git documentation:
https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---reference-if-ableltrepositorygt
file: com.pmease.quickbuild.plugin.scm.git/src/com/pmease/quickbuild/plugin/scm/git/GitCli.java
File refRepo = new File(refRepoPath);
if (!refRepo.exists()) {
throw new QuickbuildException("Reference repository path [" + refRepoPath + "] doesn't exist");
} else if (!refRepo.isDirectory()) {
throw new QuickbuildException("Reference repository path [" + refRepoPath + "] should be a git directory");
} else {
command.setLine("--reference").setValue(refRepoPath);
}