Merge branch 'sb/submodule-diff-header-fix'
authorJunio C Hamano <gitster@pobox.com>
Tue, 3 Oct 2017 06:42:49 +0000 (15:42 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Oct 2017 06:42:49 +0000 (15:42 +0900)
Error message tweak.

* sb/submodule-diff-header-fix:
submodule: correct error message for missing commits

1  2 
submodule.c
diff --combined submodule.c
index 3e3ea11761fda1c48a3cdd88e146a0f20338c364,394497bb166dd348405aa01cddefb003fa4a0471..63e7094e1620c2c3eb7dda0a8c38a833ae2d1c5a
@@@ -503,7 -503,7 +503,7 @@@ static void show_submodule_header(struc
  
        if (add_submodule_odb(path)) {
                if (!message)
-                       message = "(not initialized)";
+                       message = "(commits not present)";
                goto output_header;
        }
  
@@@ -1685,7 -1685,7 +1685,7 @@@ static int find_first_merges(struct obj
                        add_object_array(merges.objects[i].item, NULL, result);
        }
  
 -      free(merges.objects);
 +      object_array_clear(&merges);
        return result->nr;
  }
  
@@@ -1790,7 -1790,7 +1790,7 @@@ int merge_submodule(struct object_id *r
                        print_commit((struct commit *) merges.objects[i].item);
        }
  
 -      free(merges.objects);
 +      object_array_clear(&merges);
        return 0;
  }
  
@@@ -1997,10 -1997,6 +1997,10 @@@ const char *get_superproject_working_tr
        return ret;
  }
  
 +/*
 + * Put the gitdir for a submodule (given relative to the main
 + * repository worktree) into `buf`, or return -1 on error.
 + */
  int submodule_to_gitdir(struct strbuf *buf, const char *submodule)
  {
        const struct submodule *sub;