summaryrefslogtreecommitdiff
path: root/describe.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-01-15 22:25:35 -0800
committerJunio C Hamano <junkio@cox.net>2006-01-15 22:25:35 -0800
commitfec9ebf16c948bcb4a8b88d0173ee63584bcde76 (patch)
tree2cd39bed392fc4919068219cdb8ee2278a53bf15 /describe.c
parent0620db36f85788193de2102884ff8dd94222660f (diff)
parent8a263aeb4f913e04e18248eb4d370157f1d253e6 (diff)
downloadgit-fec9ebf16c948bcb4a8b88d0173ee63584bcde76.tar.gz
Merge fixes up to GIT 1.1.3
Diffstat (limited to 'describe.c')
-rw-r--r--describe.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/describe.c b/describe.c
index fabadb827f..4866510eaf 100644
--- a/describe.c
+++ b/describe.c
@@ -98,7 +98,7 @@ static int compare_names(const void *_a, const void *_b)
return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
}
-static void describe(char *arg)
+static void describe(char *arg, int last_one)
{
unsigned char sha1[20];
struct commit *cmit;
@@ -132,7 +132,8 @@ static void describe(char *arg)
if (n) {
printf("%s-g%s\n", n->path,
find_unique_abbrev(cmit->object.sha1, abbrev));
- clear_commit_marks(cmit, SEEN);
+ if (!last_one)
+ clear_commit_marks(cmit, SEEN);
return;
}
}
@@ -162,10 +163,12 @@ int main(int argc, char **argv)
}
if (i == argc)
- describe("HEAD");
+ describe("HEAD", 1);
else
- while (i < argc)
- describe(argv[i++]);
+ while (i < argc) {
+ describe(argv[i], (i == argc - 1));
+ i++;
+ }
return 0;
}