Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2010-01-24 17:09:00 +0300
committerJunio C Hamano <gitster@pobox.com>2010-01-25 08:04:31 +0300
commit721ceec1ad12625e90b395fd0be0fae9049ebc22 (patch)
tree3098483d3a51c1157b5bd9e1db7790e5137aaf2f /submodule.c
parent4d34477f4c5dbebc55aa1362fd705440590a85f1 (diff)
Teach diff --submodule that modified submodule directory is dirty
Since commit 8e08b4 git diff does append "-dirty" to the work tree side if the working directory of a submodule contains new or modified files. Lets do the same when the --submodule option is used. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/submodule.c b/submodule.c
index f657bee379..ca0527fbcb 100644
--- a/submodule.c
+++ b/submodule.c
@@ -36,6 +36,7 @@ static int add_submodule_odb(const char *path)
void show_submodule_summary(FILE *f, const char *path,
unsigned char one[20], unsigned char two[20],
+ unsigned dirty_submodule,
const char *del, const char *add, const char *reset)
{
struct rev_info rev;
@@ -85,6 +86,8 @@ void show_submodule_summary(FILE *f, const char *path,
if (!fast_backward && !fast_forward)
strbuf_addch(&sb, '.');
strbuf_addf(&sb, "%s", find_unique_abbrev(two, DEFAULT_ABBREV));
+ if (dirty_submodule)
+ strbuf_add(&sb, "-dirty", 6);
if (message)
strbuf_addf(&sb, " %s\n", message);
else