aboutsummaryrefslogtreecommitdiff
path: root/builtin-fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-10 00:47:04 -0700
committerJunio C Hamano <gitster@pobox.com>2008-04-10 00:47:04 -0700
commit71349732c53a4c1b64729628b04db7b3c3f7606d (patch)
tree22cd6c2ca4223b1a442400334958269ea1fac3ec /builtin-fetch.c
parent2a5fe2545882721d6841bad11dae0f15b454bf0d (diff)
parentf59774add488a6c5fb440a4aaa7255f594b1027d (diff)
downloadgit-71349732c53a4c1b64729628b04db7b3c3f7606d.tar.gz
git-71349732c53a4c1b64729628b04db7b3c3f7606d.tar.xz
Merge branch 'maint'
* maint: git-fetch: fix status output when not storing tracking ref core-tutorial.txt: Fix showing the current behaviour. git-archive: ignore prefix when checking file attribute Fix documentation syntax of optional arguments in short options.
Diffstat (limited to 'builtin-fetch.c')
-rw-r--r--builtin-fetch.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 5841b3e51..139a6b10c 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -215,13 +215,6 @@ static int update_local_ref(struct ref *ref,
if (type < 0)
die("object %s not found", sha1_to_hex(ref->new_sha1));
- if (!*ref->name) {
- /* Not storing */
- if (verbose)
- sprintf(display, "* branch %s -> FETCH_HEAD", remote);
- return 0;
- }
-
if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
if (verbose)
sprintf(display, "= %-*s %-*s -> %s", SUMMARY_WIDTH,
@@ -365,16 +358,21 @@ static int store_updated_refs(const char *url, struct ref *ref_map)
rm->merge ? "" : "not-for-merge",
note);
- if (ref) {
+ if (ref)
update_local_ref(ref, what, verbose, note);
- if (*note) {
- if (!shown_url) {
- fprintf(stderr, "From %.*s\n",
- url_len, url);
- shown_url = 1;
- }
- fprintf(stderr, " %s\n", note);
+ else if (verbose)
+ sprintf(note, "* %-*s %-*s -> FETCH_HEAD",
+ SUMMARY_WIDTH, *kind ? kind : "branch",
+ REFCOL_WIDTH, *what ? what : "HEAD");
+ else
+ *note = '\0';
+ if (*note) {
+ if (!shown_url) {
+ fprintf(stderr, "From %.*s\n",
+ url_len, url);
+ shown_url = 1;
}
+ fprintf(stderr, " %s\n", note);
}
}
fclose(fp);