/** * Get attribute value * * @param key * an attribute key * @return the attribute value (may be <code>null</code>) */ public String getValue(String key) { Attribute a = map.get(key); return a != null ? a.getValue() : null; }
/** Parses an attribute value from a list of rules, returning null if there is no match for the given key. */ private static @Nullable String findAttributeInRules(String subpath, boolean isFolder, String key, List<AttributesRule> rules) { String value = null; // later rules override earlier ones for (AttributesRule rule : rules) { if (rule.isMatch(subpath, isFolder)) { for (Attribute attribute : rule.getAttributes()) { if (attribute.getKey().equals(key)) { value = attribute.getValue(); } } } } return value; } }
return null; String filterValue = f.getValue(); if (filterValue == null) { return null;
/** * @param key * @return the attribute value (may be <code>null</code>) */ public String getValue(String key) { Attribute a = map.get(key); return a != null ? a.getValue() : null; }
/** * Get attribute value * * @param key * an attribute key * @return the attribute value (may be <code>null</code>) */ public String getValue(String key) { Attribute a = map.get(key); return a != null ? a.getValue() : null; }
/** * @param db * the repository * @param attribute * the attribute to check * @return whether LFS filter is enabled for the given .gitattribute * attribute. */ private boolean isEnabled(Repository db, Attribute attribute) { if (attribute == null) { return false; } return isEnabled(db) && ConfigConstants.CONFIG_SECTION_LFS .equals(attribute.getValue()); }
case CUSTOM: default: expandMacro(new Attribute(e.getKey(), attr.getValue()), result);
/** Parses an attribute value from a list of rules, returning null if there is no match for the given key. */ private static @Nullable String findAttributeInRules(String subpath, boolean isFolder, String key, List<AttributesRule> rules) { String value = null; // later rules override earlier ones for (AttributesRule rule : rules) { if (rule.isMatch(subpath, isFolder)) { for (Attribute attribute : rule.getAttributes()) { if (attribute.getKey().equals(key)) { value = attribute.getValue(); } } } } return value; } }
return null; String filterValue = f.getValue(); if (filterValue == null) { return null;
/** * Inspect config and attributes to return a filtercommand applicable for * the current path * * @param filterCommandType * which type of filterCommand should be executed. E.g. "clean", * "smudge" * @return a filter command * @throws IOException * @since 4.2 */ public String getFilterCommand(String filterCommandType) throws IOException { Attributes attributes = getAttributes(); Attribute f = attributes.get(Constants.ATTR_FILTER); if (f == null) { return null; } String filterValue = f.getValue(); if (filterValue == null) { return null; } String filterCommand = getFilterCommandDefinition(filterValue, filterCommandType); if (filterCommand == null) { return null; } return filterCommand.replaceAll("%f", //$NON-NLS-1$ QuotedString.BOURNE.quote((getPathString()))); }
case CUSTOM: default: expandMacro(new Attribute(e.getKey(), attr.getValue()), result);
case CUSTOM: default: expandMacro(new Attribute(e.getKey(), attr.getValue()), result);