Skip to content

Commit 03d5f29

Browse files
committed
BUGFIX: The default permissions should be 100644
This is a change from the previous code but is more in keeping with the default behaviour of git. Signed-off-by: Andrew Thornton <[email protected]>
1 parent 2f8ec3d commit 03d5f29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

models/repo_editor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) (
305305
}
306306

307307
// Add the object to the index
308-
if err := repo.addObjectToIndex(tmpBasePath, "100666", objectHash, opts.NewTreeName); err != nil {
308+
if err := repo.addObjectToIndex(tmpBasePath, "100644", objectHash, opts.NewTreeName); err != nil {
309309
return err
310310
}
311311

@@ -418,7 +418,7 @@ func (repo *Repository) GetDiffPreview(branch, treePath, content string) (diff *
418418
}
419419

420420
// Add the object to the index
421-
if err := repo.addObjectToIndex(tmpBasePath, "100666", objectHash, treePath); err != nil {
421+
if err := repo.addObjectToIndex(tmpBasePath, "100644", objectHash, treePath); err != nil {
422422
return nil, fmt.Errorf("GetDiffPreview: %v", err)
423423
}
424424

@@ -704,7 +704,7 @@ func (repo *Repository) UploadRepoFiles(doer *User, opts UploadRepoFileOptions)
704704
}
705705

706706
// Add the object to the index
707-
if err := repo.addObjectToIndex(tmpBasePath, "100666", objectHash, path.Join(opts.TreePath, upload.Name)); err != nil {
707+
if err := repo.addObjectToIndex(tmpBasePath, "100644", objectHash, path.Join(opts.TreePath, upload.Name)); err != nil {
708708
return err
709709
}
710710
}

0 commit comments

Comments
 (0)