Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Avoid dirty submodules for Carthage users #21

Merged
merged 1 commit into from
Feb 10, 2017

Conversation

Kuniwak
Copy link
Contributor

@Kuniwak Kuniwak commented Feb 9, 2017

Carthage creates the directory Carthage/Build for every submodules when using carthage update --submodule. This behavior leads to dirty submodule, because .gitignore of R.swift.Library does not include Carthage/Build. After this patch, Carthage/Build in R.swift.Library will be ignored, so the submodule do not get dirty.

How to test this patch

You can test this patch by using the sample app.

Before this patch

$ git checkout master
$ carthage update --use-submodules
...

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

        modified:   Carthage/Checkouts/R.swift.Library (untracked content)

no changes added to commit (use "git add" and/or "git commit -a")

$ git diff
diff --git a/Carthage/Checkouts/R.swift.Library b/Carthage/Checkouts/R.swift.Library
--- a/Carthage/Checkouts/R.swift.Library
+++ b/Carthage/Checkouts/R.swift.Library
@@ -1 +1 @@
-Subproject commit b520035ddad4a47eb580b576ba5c6fb72df51c97
+Subproject commit b520035ddad4a47eb580b576ba5c6fb72df51c97-dirty 👈

After this patch

$ git checkout patched
$ carthage update --use-submodules
...

$ git status
On branch patched
Your branch is up-to-date with 'origin/patched'.
nothing to commit, working tree clean 🎉

Carthage creates the directory `Carthage/Build` for every submodules when using `carthage update --submodule`.
This behavior leads to dirty submodule.
After this patch, `Carthage/Build` in R.swift.Library will be ignored, so the submodule do not get dirty.
@mac-cain13
Copy link
Owner

Awesome PR description! Thanks. :)

@mac-cain13 mac-cain13 merged commit 594965c into mac-cain13:master Feb 10, 2017
@Kuniwak Kuniwak deleted the avoid-dirty-submodule branch February 13, 2017 06:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants