/** * Get submodule URL * * @param name The name of the submodule * @throws GitException if executing the git command fails */ public String getSubmoduleUrl(String name) throws GitException { String result = launchCommand("config", "--get", "submodule." + name + ".url"); return firstLine(result).trim(); }
/** * From a given repository, get a remote's URL * * @param name The name of the remote (e.g. origin) * @param GIT_DIR The path to the repository (must be to .git dir) * @throws GitException if executing the git command fails */ public String getRemoteUrl(String name, String GIT_DIR) throws GitException { String result = launchCommand("--git-dir=" + GIT_DIR, "config", "--get", "remote." + name + ".url"); return firstLine(result).trim(); }
/** * Get a remote's URL * * @param name The name of the remote (e.g. origin) * @throws GitException if executing the git command fails */ public String getRemoteUrl(String name) throws GitException { String result = launchCommand("config", "--get", "remote." + name + ".url"); return firstLine(result).trim(); }
/** * Get submodule URL * * @param name The name of the submodule * @throws GitException if executing the git command fails */ public String getSubmoduleUrl(String name) throws GitException { String result = launchCommand("config", "--get", "submodule." + name + ".url"); return firstLine(result).trim(); }
/** * Get a remote's URL * * @param name The name of the remote (e.g. origin) * @throws GitException if executing the git command fails */ public String getRemoteUrl(String name) throws GitException { String result = launchCommand("config", "--get", "remote." + name + ".url"); return firstLine(result).trim(); }
public String describe(String commitIsh) throws GitException { String result = launchCommand("describe", "--tags", commitIsh); return firstLine(result).trim(); }
public String describe(String commitIsh) throws GitException { String result = launchCommand("describe", "--tags", commitIsh); return firstLine(result).trim(); }
/** * From a given repository, get a remote's URL * * @param name The name of the remote (e.g. origin) * @param GIT_DIR The path to the repository (must be to .git dir) * @throws GitException if executing the git command fails */ public String getRemoteUrl(String name, String GIT_DIR) throws GitException { String result = launchCommand("--git-dir=" + GIT_DIR, "config", "--get", "remote." + name + ".url"); return firstLine(result).trim(); }
public ObjectId revParse(String revName) throws GitException { String result = launchCommand("rev-parse", revName); return ObjectId.fromString(firstLine(result).trim()); }
public ObjectId revParse(String revName) throws GitException { String result = launchCommand("rev-parse", revName); return ObjectId.fromString(firstLine(result).trim()); }
/** * Detect whether a repository at the given path is bare or not. * * @param GIT_DIR The path to the repository (must be to .git dir). * @throws GitException */ public boolean isBareRepository(String GIT_DIR) throws GitException { String ret = null; if ("".equals(GIT_DIR)) { ret = launchCommand("rev-parse", "--is-bare-repository"); } else { String gitDir = "--git-dir=" + GIT_DIR; ret = launchCommand(gitDir, "rev-parse", "--is-bare-repository"); } if ("false".equals(firstLine(ret).trim())) { return false; } else { return true; } }
/** * Detect whether a repository at the given path is bare or not. * * @param GIT_DIR The path to the repository (must be to .git dir). * @throws GitException */ public boolean isBareRepository(String GIT_DIR) throws GitException { String ret; if ("".equals(GIT_DIR)) { ret = launchCommand("rev-parse", "--is-bare-repository"); } else { String gitDir = "--git-dir=" + GIT_DIR; ret = launchCommand(gitDir, "rev-parse", "--is-bare-repository"); } if ("false".equals(firstLine(ret).trim())) { return false; } else { return true; } }