Skip to content

Commit 446ea44

Browse files
committed
[Repository] Strip basic auth info
1 parent a0fb3dd commit 446ea44

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/huggingface_hub/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818

19-
__version__ = "0.0.5"
19+
__version__ = "0.0.6"
2020

2121
from .constants import (
2222
CONFIG_NAME,

src/huggingface_hub/repository.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
import os
3+
import re
34
import subprocess
45
from typing import List, Optional, Union
56

@@ -252,7 +253,9 @@ def git_remote_url(self) -> str:
252253
check=True,
253254
cwd=self.local_dir,
254255
)
255-
return p.stdout.strip()
256+
url = p.stdout.strip()
257+
# Strip basic auth info.
258+
return re.sub(r"https://.*@", "https://", url)
256259
except subprocess.CalledProcessError as exc:
257260
raise EnvironmentError(exc.stderr)
258261

0 commit comments

Comments
 (0)