def METHOD_NAME(tree, git_repo):
    tree.add_project(git_repo)
    [git_repo_id] = tree.get_children()
    tree.selection_set(git_repo_id)
    tree._populate_contextmenu()
    assert tree.contextmenu.entrycget("git add", "state") == "normal"
    assert tree.contextmenu.entrycget("* (undo add)", "state") == "normal"
    assert tree.contextmenu.entrycget("* (discard non-added changes)", "state") == "normal"
    tree.contextmenu.invoke("git add")
    tree._populate_contextmenu()
    assert tree.contextmenu.entrycget("git add", "state") == "disabled"
    assert tree.contextmenu.entrycget("* (undo add)", "state") == "normal"
    assert tree.contextmenu.entrycget("* (discard non-added changes)", "state") == "disabled"