Skip to content

Commit

Permalink
fix(cli): fix mergetool committing more than .gitattributes (#3013)
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Jul 14, 2022
1 parent e5420f6 commit 3905d78
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions renku/command/command_builder/command.py
Expand Up @@ -21,7 +21,8 @@
import functools
import threading
from collections import defaultdict
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union

import click
import inject
Expand Down Expand Up @@ -433,7 +434,7 @@ def with_commit(
message: Optional[str] = None,
commit_if_empty: bool = False,
raise_if_empty: bool = False,
commit_only: Optional[bool] = None,
commit_only: Optional[Union[str, List[Union[str, Path]]]] = None,
skip_staging: bool = False,
) -> "Command":
"""Create a commit.
Expand Down
5 changes: 3 additions & 2 deletions renku/command/command_builder/repo.py
Expand Up @@ -17,7 +17,8 @@
# limitations under the License.
"""Command builder for repository."""

from typing import Optional
from pathlib import Path
from typing import List, Optional, Union

from renku.command.command_builder.command import Command, CommandResult, check_finalized
from renku.core import errors
Expand All @@ -34,7 +35,7 @@ def __init__(
message: Optional[str] = None,
commit_if_empty: Optional[bool] = False,
raise_if_empty: Optional[bool] = False,
commit_only: Optional[bool] = None,
commit_only: Optional[Union[str, List[Union[str, Path]]]] = None,
skip_staging: bool = False,
) -> None:
"""__init__ of Commit.
Expand Down
2 changes: 1 addition & 1 deletion renku/ui/cli/mergetool.py
Expand Up @@ -58,4 +58,4 @@ def install():
"""Setup mergetool locally."""
from renku.command.mergetool import mergetool_install_command

mergetool_install_command().with_commit().build().execute()
mergetool_install_command().with_commit(commit_only=[".gitattributes"]).require_clean().build().execute()

0 comments on commit 3905d78

Please sign in to comment.