Support project and repo specific fetch override tags

Bug: 353340
Change-Id: I7f9f1f3ee33373f26ef7f06c9c1cebe6610fe103
diff --git a/org.eclipse.egit.fetchfactory/src/org/eclipse/egit/internal/fetchfactory/GITFetchTaskFactory.java b/org.eclipse.egit.fetchfactory/src/org/eclipse/egit/internal/fetchfactory/GITFetchTaskFactory.java
index 370e1a8..1a53729 100644
--- a/org.eclipse.egit.fetchfactory/src/org/eclipse/egit/internal/fetchfactory/GITFetchTaskFactory.java
+++ b/org.eclipse.egit.fetchfactory/src/org/eclipse/egit/internal/fetchfactory/GITFetchTaskFactory.java
@@ -436,8 +436,18 @@
 

 		// add entries to the entryInfo map here instead of inside the loop

 		// to avoid contaminating entryInfos

-		final String overrideTag = overrideTags != null ? overrideTags

-				.getProperty(OVERRIDE_TAG) : null;

+		String overrideTag = null;

+		if (overrideTags != null) {

+			// Check for overrides first for the project, then for the repo, and

+			// finally for Git in general.

+			overrideTag = overrideTags.getProperty((String) entryInfos

+					.get(KEY_ELEMENT_NAME));

+			if (overrideTag == null)

+				overrideTag = overrideTags.getProperty(table.get(KEY_REPO));

+			if (overrideTag == null)

+				overrideTag = overrideTags.getProperty(OVERRIDE_TAG);

+		}

+

 		entryInfos

 				.put(IFetchFactory.KEY_ELEMENT_TAG, (overrideTag != null

 						&& overrideTag.trim().length() != 0 ? overrideTag