Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf7d276

Browse files
committed
Merge pull request libgit2#3280 from linquize/8.3
Fix 8.3 filename tests failure when 8.3 is disabled
2 parents 3406596 + 526f91f commit bf7d276

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/repository.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,15 +867,18 @@ static int reserved_names_add8dot3(git_repository *repo, const char *path)
867867
{
868868
char *name = git_win32_path_8dot3_name(path);
869869
const char *def = GIT_DIR_SHORTNAME;
870+
const char *def_dot_git = DOT_GIT;
870871
size_t name_len, def_len = CONST_STRLEN(GIT_DIR_SHORTNAME);
872+
size_t def_dot_git_len = CONST_STRLEN(DOT_GIT);
871873
git_buf *buf;
872874

873875
if (!name)
874876
return 0;
875877

876878
name_len = strlen(name);
877879

878-
if (name_len == def_len && memcmp(name, def, def_len) == 0) {
880+
if ((name_len == def_len && memcmp(name, def, def_len) == 0) ||
881+
(name_len == def_dot_git_len && memcmp(name, def_dot_git, def_dot_git_len) == 0)) {
879882
git__free(name);
880883
return 0;
881884
}

0 commit comments

Comments
 (0)