Skip to content

Commit

Permalink
[Repository] Strip basic auth info
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-c committed Mar 2, 2021
1 parent a0fb3dd commit 446ea44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/huggingface_hub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.0.5"
__version__ = "0.0.6"

from .constants import (
CONFIG_NAME,
Expand Down
5 changes: 4 additions & 1 deletion src/huggingface_hub/repository.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import os
import re
import subprocess
from typing import List, Optional, Union

Expand Down Expand Up @@ -252,7 +253,9 @@ def git_remote_url(self) -> str:
check=True,
cwd=self.local_dir,
)
return p.stdout.strip()
url = p.stdout.strip()
# Strip basic auth info.
return re.sub(r"https://.*@", "https://", url)
except subprocess.CalledProcessError as exc:
raise EnvironmentError(exc.stderr)

Expand Down

0 comments on commit 446ea44

Please sign in to comment.