private void merge(Program sourceProgram, TaskMonitor monitor)
			throws CancelledException, IOException {

		// First get the tag from the source program and Result		
		FunctionTag tag = getTag(sourceProgram, currentlyMergingTagID);
		FunctionTag resultTag = getTag(resultProgram, currentlyMergingTagID);

		// Get the Result tag manager so we can use it to store the new 
		// tag info.
		FunctionManagerDB functionManagerDBResult =
			(FunctionManagerDB) resultProgram.getFunctionManager();

		int transactionID = resultProgram.startTransaction(getDescription());

		try {
			// If the source program tag doesn't exist then the user has chosen to 
			// keep a deleted tag, so make sure the corresponding tag in Result
			// is deleted as well. 
			if (tag == null) {
				if (resultTag != null) {
					resultTag.delete();
				}
			}

			// If the source tag exists, but the Result tag doesn't, we have to create a new
			// one in Result.
			else if (resultTag == null) {
				functionManagerDBResult.getFunctionTagManager()
						.createFunctionTag(tag.getName(),
							tag.getComment());
			}

			// If the source tag exists and Result tag exists, just update the tag 
			// attributes in Result.
			else {
				resultTag.setName(tag.getName());
				resultTag.setComment(tag.getComment());
			}
		}
		finally {
			resultProgram.endTransaction(transactionID, true);
		}

		mergeManager.setCompleted(FUNCTION_TAG_PHASE);
	}
Merges the tag being currently resolved into the Result program. 

@param sourceProgram
@param monitor
@throws CancelledException
@throws IOException
Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/FunctionTagMerger.java