Skip to content
Snippets Groups Projects

Add functionality to create a directory with an empty .gitkeep file

Merged Stan Hu requested to merge stanhu/gitlab_git:add-mkdir-support into master

This is in preparation to support gitlab-org/gitlab-ce#2557.

Also fixes an issue where file modes were overwritten after a commit: gitlab-org/gitlab-ce#2799.

Supports capability to reject updates of existing files: https://github.com/gitlabhq/gitlabhq/issues/8253

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • fc823bda - Clean up code
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 4048268e - Add functionality to create a directory with an empty .gitkeep file
  • @stanhu Great work, a work of art indeed!

  • Douwe Maan
    Douwe Maan @DouweM started a thread on the diff
  • 813 # options should contain next structure:
    814 # author: {
    815 # email: 'user@example.com',
    816 # name: 'Test User',
    817 # time: Time.now
    818 # },
    819 # committer: {
    820 # email: 'user@example.com',
    821 # name: 'Test User',
    822 # time: Time.now
    823 # },
    824 # commit: {
    825 # message: 'Wow such commit',
    826 # branch: 'master'
    827 # }
    828 def mkdir(path, options = {})
  • Stan Hu Added 5 commits:

    Added 5 commits:

    • 4048268e...56471f8f - 3 commits from branch gitlab-org:master
    • 29236fa2 - Add functionality to create a directory with an empty .gitkeep file
    • a83825c5 - Handle relative paths
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • e9e8fc5b - Clean up spec
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 74b803d8 - Simplify mkdir and create all required directories
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 64acb7ac - Refactor tests
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 49f9369a - Revise test for invalid filenames
  • Author Maintainer

    @DouweM, ok, simplified the code quite a bit. Now works as mkdir -p.

    EDIT: New bug. Existing filename gets overwritten by the directory.

    Edited by Stan Hu
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • f83602c2 - Don't overwrite existing files
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 092e5d0f - Fix missing space
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • b43ba63d - Fix bug where tree_entry could return a false entry
  • Stan Hu Added 13 commits:

    Added 13 commits:

    • b43ba63d...dfc0fc2b - 3 commits from branch gitlab-org:master
    • fecece72 - Add functionality to create a directory with an empty .gitkeep file
    • 510d120e - Handle relative paths
    • ed74facb - Clean up spec
    • bb4da147 - Simplify mkdir and create all required directories
    • 100c278e - Refactor tests
    • cd569714 - Revise test for invalid filenames
    • cc61f4fa - Don't overwrite existing files
    • 8a911965 - Fix missing space
    • 51b65053 - Fix bug where tree_entry could return a false entry
    • 3c164e33 - Raise exceptions upon failure
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 2adc3b83 - Fix CHANGELOG
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 52b4cff8 - Strip all leading slashes properly
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 9af6b6d3 - Raise custom errors
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • b42c22cc - Simplify mkdir and create all required directories
  • Stan Hu Title changed from Add functionality to create a directory with an empty .gitkeep file to WIP: Add functionality to create a directory with an empty .gitkeep file

    Title changed from Add functionality to create a directory with an empty .gitkeep file to WIP: Add functionality to create a directory with an empty .gitkeep file

  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 2c022214 - Simplify implementation by reusing Blob::commit
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • b5fe94ec - Fix typo
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 4dd27080 - Preserve file mode when updating existing file
  • Stan Hu Title changed from WIP: Add functionality to create a directory with an empty .gitkeep file to Add functionality to create a directory with an empty .gitkeep file

    Title changed from WIP: Add functionality to create a directory with an empty .gitkeep file to Add functionality to create a directory with an empty .gitkeep file

  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 3fc8607c - Preserve file mode when updating existing file
  • Stan Hu Added 2 commits:

    Added 2 commits:

    • 47a3a603 - Simplify implementation by reusing Blob::commit
    • a89ba29c - Preserve file mode when updating existing file
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • ea3c125d - Update CHANGELOG
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 8bedde45 - Add functionality to create a directory with an empty .gitkeep file
  • Author Maintainer

    @DouweM, ok I've updated the code to reuse and improve the existing Blob::commit code. Please review.

  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 8aa9ee78 - Add functionality to create a directory with an empty .gitkeep file
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • a04ba057 - Incorporate review comments
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • def114e8 - Incorporate review comments
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • ad5cf444 - Add functionality to create a directory with an empty .gitkeep file
  • @stanhu Awesome :) Ready to merge or do you want to tweak some more? :P

    Edited by Douwe Maan
  • Author Maintainer

    @DouweM, ready to merge! Thanks.

  • Douwe Maan Status changed to merged

    Status changed to merged

  • Douwe Maan mentioned in commit 95b35fac

    mentioned in commit 95b35fac

  • @stanhu Merged and released 7.2.18.

  • Author Maintainer

    Thanks, @DouweM!

  • Please register or sign in to reply
    Loading