aboutsummaryrefslogtreecommitdiff
path: root/t/t7506-status-submodule.sh
Commit message (Collapse)AuthorAge
* Merge branch 'jl/submodule-conflicted-gitmodules'Junio C Hamano2011-05-19
|\ | | | | | | | | | | * jl/submodule-conflicted-gitmodules: Submodules: Don't parse .gitmodules when it contains, merge conflicts test that git status works with merge conflict in, .gitmodules
| * Submodules: Don't parse .gitmodules when it contains, merge conflictsJens Lehmann2011-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commands like "git status", "git diff" and "git fetch" would fail when the .gitmodules file contained merge conflicts because the config parser would call die() when hitting the conflict markers: "fatal: bad config file line <n> in <path>/.gitmodules" While this behavior was on the safe side, it is really unhelpful to the user to have commands like status and diff fail, as these are needed to find out what's going on. And the error message is only mildly helpful, as it points to the right file but doesn't mention that it is unmerged. Users of git gui were not shown any conflicts at all when this happened. Improve the situation by checking if the index records .gitmodules as unmerged. When that is the case we can't make any assumptions about the configuration to be found there after the merge conflict is resolved by the user, so assume that all recursion is disabled unless .git/config or the global config say otherwise. As soon as the merge conflict is resolved and the .gitmodules file has been staged subsequent commands again honor any configuration done there. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * test that git status works with merge conflict in, .gitmodulesHeiko Voigt2011-05-14
| | | | | | | | | | | | | | | | | | | | | | For example: Two users independently adding a submodule will result in a merge conflict in .gitmodules. Since configuration of the status and diff machinery depends on the file being parseable they currently fail to produce useable output in case .gitmodules is marked with a merge conflict. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: use test_i18ngrep in t7506Junio C Hamano2011-04-14
|/ | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* i18n: git-status "nothing to commit" messagesÆvar Arnfjörð Bjarmason2011-03-09
| | | | | | | | | Gettextize the "nothing to commit" messages. Many tests explicitly checked for this message. Change them to skip under GETTEXT_POISON=YesPlease. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* i18n: git-status basic messagesÆvar Arnfjörð Bjarmason2011-03-09
| | | | | | | | | | | | Gettextize the most common git-status messages. Many tests checked for these explicitly. Change them to skip under GETTEXT_POISON=YesPlease. Some of the tests in t7508-status.sh needed to be split up when I added C_LOCALE_OUTPUT to them, since parts of them affected later tests (some of which aren't being skipped) indirectly. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Teach diff --submodule and status to handle .git files in submodulesJens Lehmann2010-04-10
| | | | | | | | | | | | | | | | The simple test for an existing .git directory gives an incorrect result if .git is a file that records "gitdir: overthere". So for submodules that use a .git file, "git status" and the diff family - when the "--submodule" option is given - did assume the submodule was not populated at all when a .git file was used, thus generating wrong output or no output at all. This is fixed by using read_gitfile_gently() to get the correct location of the .git directory. While at it, is_submodule_modified() was cleaned up to use the "dir" member of "struct child_process" instead of setting the GIT_WORK_TREE and GIT_DIR environment variables. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git status: ignoring untracked files must apply to submodules tooJens Lehmann2010-03-13
| | | | | | | | | | | Since 1.7.0 submodules are considered dirty when they contain untracked files. But when git status is called with the "-uno" option, the user asked to ignore untracked files, so they must be ignored in submodules too. To achieve this, the new flag DIFF_OPT_IGNORE_UNTRACKED_IN_SUBMODULES is introduced. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git status: Fix false positive "new commits" output for dirty submodulesJens Lehmann2010-03-12
| | | | | | | | | | | | | | | | | | | | | | | Testing if the output "new commits" should appear in the long format of "git status" is done by comparing the hashes of the diffpair. This always resulted in printing "new commits" for submodules that contained untracked or modified content, even if they did not contain new commits. The reason was that match_stat_with_submodule() did set the "changed" flag for dirty submodules, resulting in two->sha1 being set to the null_sha1 at the call sites, which indicates that new commits are present. This is changed so that when no new commits are present, the same object names are in the sha1 field for both sides of the filepair, and the working tree side will have the "dirty_submodule" flag set when appropriate. For a submodule to be seen as modified even when it just has a dirty work tree, some conditions had to be extended to also check for the "dirty_submodule" flag. Unfortunately the test case that should have found this bug had been changed incorrectly too. It is fixed and extended to test for other combinations too. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git status: Show detailed dirty status of submodules in long formatJens Lehmann2010-03-08
| | | | | | | | | | | | | | | | | | | Since 1.7.0 there are three reasons a submodule is considered modified against the work tree: It contains new commits, modified content or untracked content. Lets show all reasons in the long format of git status, so the user can better asses the nature of the modification. This change does not affect the short and porcelain formats. Two new members are added to "struct wt_status_change_data" to store the information gathered by run_diff_files(). wt-status.c uses the new flag DIFF_OPT_DIRTY_SUBMODULES to tell diff-lib.c it wants to get detailed dirty information about submodules. A hint line for submodules is printed in the dirty header when dirty submodules are present. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Show submodules as modified when they contain a dirty work treeJens Lehmann2010-01-16
| | | | | | | | | | | | | | | | | Until now a submodule only then showed up as modified in the supermodule when the last commit in the submodule differed from the one in the index or the diffed against commit of the superproject. A dirty work tree containing new untracked or modified files in a submodule was undetectable when looking at it from the superproject. Now git status and git diff (against the work tree) in the superproject will also display submodules as modified when they contain untracked or modified files, even if the compared ref matches the HEAD of the submodule. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git status: not "commit --dry-run" anymoreJunio C Hamano2009-08-22
| | | | | | | | | | | | | | | This removes tentative "git stat" and make it take over "git status". There are some tests that expect "git status" to exit with non-zero status when there is something staged. Some tests expect "git status path..." to show the status for a partial commit. For these, replace "git status" with "git commit --dry-run". For the ones that do not attempt a dry-run of a partial commit that check the output from the command, check the output from "git status" as well, as they should be identical. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* tests: use "git xyzzy" form (t7200 - t9001)Nanako Shiraishi2008-09-03
| | | | | | | Converts tests between t7201-t9001. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* is_racy_timestamp(): do not check timestamp for gitlinksJunio C Hamano2008-05-04
| | | | | | | | | | Because we do not even check the timestamp to determie if a gitlink is up to date or not, triggering the racy-timestamp check for gitlinks does not make sense. This fixes the recently added test in t7506. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add t7506 to test submodule related functions for git-statusPing Yin2008-05-04
Signed-off-by: Ping Yin <pkufranky@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>