diff options
Diffstat (limited to 'ex')
-rw-r--r-- | ex/HEAD/add.html | 19 | ||||
-rw-r--r-- | ex/HEAD/blame.html | 4 | ||||
-rw-r--r-- | ex/HEAD/commit.html | 22 | ||||
-rw-r--r-- | ex/HEAD/diff.html | 2 | ||||
-rw-r--r-- | ex/HEAD/ls-remote.html | 6 | ||||
-rw-r--r-- | ex/HEAD/remote.html | 2 | ||||
-rw-r--r-- | ex/HEAD/status.html | 2 |
7 files changed, 35 insertions, 22 deletions
diff --git a/ex/HEAD/add.html b/ex/HEAD/add.html index 5f5b00f24..e0f5f8996 100644 --- a/ex/HEAD/add.html +++ b/ex/HEAD/add.html @@ -101,7 +101,7 @@ on files passed as its parameters.</p> <td class=code> <div class='highlight'><pre><span class="k">enum</span> <span class="n">index_mode</span> <span class="p">{</span> <span class="n">INDEX_NONE</span><span class="p">,</span> - <span class="n">INDEX_ADD</span> + <span class="n">INDEX_ADD</span><span class="p">,</span> <span class="p">};</span> <span class="k">struct</span> <span class="n">index_options</span> <span class="p">{</span> @@ -183,7 +183,22 @@ on files passed as its parameters.</p> <span class="k">return</span> <span class="n">ret</span><span class="p">;</span> <span class="p">}</span> -<span class="k">static</span> <span class="kt">void</span> <span class="nf">print_usage</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> +<span class="kt">void</span> <span class="nf">init_array</span><span class="p">(</span><span class="n">git_strarray</span> <span class="o">*</span><span class="n">array</span><span class="p">,</span> <span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span> +<span class="p">{</span> + <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">i</span><span class="p">;</span> + + <span class="n">array</span><span class="o">-></span><span class="n">count</span> <span class="o">=</span> <span class="n">argc</span><span class="p">;</span> + <span class="n">array</span><span class="o">-></span><span class="n">strings</span> <span class="o">=</span> <span class="n">calloc</span><span class="p">(</span><span class="n">array</span><span class="o">-></span><span class="n">count</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="kt">char</span> <span class="o">*</span><span class="p">));</span> + <span class="n">assert</span><span class="p">(</span><span class="n">array</span><span class="o">-></span><span class="n">strings</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">);</span> + + <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">array</span><span class="o">-></span><span class="n">count</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> + <span class="n">array</span><span class="o">-></span><span class="n">strings</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="p">];</span> + <span class="p">}</span> + + <span class="k">return</span><span class="p">;</span> +<span class="p">}</span> + +<span class="kt">void</span> <span class="nf">print_usage</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"usage: add [options] [--] file-spec [file-spec] [...]</span><span class="se">\n\n</span><span class="s">"</span><span class="p">);</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"</span><span class="se">\t</span><span class="s">-n, --dry-run dry run</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> diff --git a/ex/HEAD/blame.html b/ex/HEAD/blame.html index ac74bbe96..d24dd6950 100644 --- a/ex/HEAD/blame.html +++ b/ex/HEAD/blame.html @@ -126,7 +126,7 @@ simulate the output of <code>git blame</code> and a few of its command line argu <div class="pilwrap"> <a class="pilcrow" href="#section-3">¶</a> </div> - <p>The commit range comes in "committish" form. Use the rev-parse API to + <p>The commit range comes in "commitish" form. Use the rev-parse API to nail down the end points.</p> </td> <td class=code> @@ -161,7 +161,7 @@ nail down the end points.</p> <a class="pilcrow" href="#section-5">¶</a> </div> <p>Get the raw data inside the blob for output. We use the -<code>committish:path/to/file.txt</code> format to find it.</p> +<code>commitish:path/to/file.txt</code> format to find it.</p> </td> <td class=code> <div class='highlight'><pre> <span class="k">if</span> <span class="p">(</span><span class="n"><a name="git_oid_is_zero-21" class="fnlink" href="../../#HEAD/group/oid/git_oid_is_zero">git_oid_is_zero</a></span><span class="p">(</span><span class="o">&</span><span class="n">blameopts</span><span class="p">.</span><span class="n">newest_commit</span><span class="p">))</span> diff --git a/ex/HEAD/commit.html b/ex/HEAD/commit.html index 23c90f91e..58bf62adf 100644 --- a/ex/HEAD/commit.html +++ b/ex/HEAD/commit.html @@ -113,10 +113,10 @@ simulate <code>git commit</code> with the commit message argument.</p> <span class="n">git_oid</span> <span class="n">commit_oid</span><span class="p">,</span><span class="n">tree_oid</span><span class="p">;</span> <span class="n">git_tree</span> <span class="o">*</span><span class="n">tree</span><span class="p">;</span> - <span class="n">git_index</span> <span class="o">*</span><span class="n">index</span><span class="p">;</span> + <span class="n">git_index</span> <span class="o">*</span><span class="n">index</span><span class="p">;</span> <span class="n">git_object</span> <span class="o">*</span><span class="n">parent</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span> <span class="n">git_reference</span> <span class="o">*</span><span class="n">ref</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span> - <span class="n">git_signature</span> <span class="o">*</span><span class="n">signature</span><span class="p">;</span> + <span class="n">git_signature</span> <span class="o">*</span><span class="n">signature</span><span class="p">;</span> <span class="cm">/* Validate args */</span> <span class="k">if</span> <span class="p">(</span><span class="n">argc</span> <span class="o"><</span> <span class="mi">3</span> <span class="o">||</span> <span class="n">strcmp</span><span class="p">(</span><span class="n">opt</span><span class="p">,</span> <span class="s">"-m"</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span> @@ -124,7 +124,7 @@ simulate <code>git commit</code> with the commit message argument.</p> <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="p">}</span> - <span class="n">error</span> <span class="o">=</span> <span class="n"><a name="git_revparse_ext-9" class="fnlink" href="../../#HEAD/group/revparse/git_revparse_ext">git_revparse_ext</a></span><span class="p">(</span><span class="o">&</span><span class="n">parent</span><span class="p">,</span> <span class="o">&</span><span class="n">ref</span><span class="p">,</span> <span class="n">repo</span><span class="p">,</span> <span class="s">"HEAD"</span><span class="p">);</span> + <span class="n">error</span> <span class="o">=</span> <span class="n"><a name="git_revparse_ext-7" class="fnlink" href="../../#HEAD/group/revparse/git_revparse_ext">git_revparse_ext</a></span><span class="p">(</span><span class="o">&</span><span class="n">parent</span><span class="p">,</span> <span class="o">&</span><span class="n">ref</span><span class="p">,</span> <span class="n">repo</span><span class="p">,</span> <span class="s">"HEAD"</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="n">error</span> <span class="o">==</span> <span class="n">GIT_ENOTFOUND</span><span class="p">)</span> <span class="p">{</span> <span class="n">printf</span><span class="p">(</span><span class="s">"HEAD not found. Creating first commit</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="n">error</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> @@ -134,14 +134,14 @@ simulate <code>git commit</code> with the commit message argument.</p> <span class="k">else</span> <span class="n">printf</span><span class="p">(</span><span class="s">"ERROR %d: no detailed info</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">error</span><span class="p">);</span> <span class="p">}</span> - <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_repository_index-8" class="fnlink" href="../../#HEAD/group/repository/git_repository_index">git_repository_index</a></span><span class="p">(</span><span class="o">&</span><span class="n">index</span><span class="p">,</span> <span class="n">repo</span><span class="p">),</span> <span class="s">"Could not open repository index"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> + <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_repository_index-6" class="fnlink" href="../../#HEAD/group/repository/git_repository_index">git_repository_index</a></span><span class="p">(</span><span class="o">&</span><span class="n">index</span><span class="p">,</span> <span class="n">repo</span><span class="p">),</span> <span class="s">"Could not open repository index"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_index_write_tree-5" class="fnlink" href="../../#HEAD/group/index/git_index_write_tree">git_index_write_tree</a></span><span class="p">(</span><span class="o">&</span><span class="n">tree_oid</span><span class="p">,</span> <span class="n">index</span><span class="p">),</span> <span class="s">"Could not write tree"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);;</span> <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_index_write-4" class="fnlink" href="../../#HEAD/group/index/git_index_write">git_index_write</a></span><span class="p">(</span><span class="n">index</span><span class="p">),</span> <span class="s">"Could not write index"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);;</span> - <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_tree_lookup-12" class="fnlink" href="../../#HEAD/group/tree/git_tree_lookup">git_tree_lookup</a></span><span class="p">(</span><span class="o">&</span><span class="n">tree</span><span class="p">,</span> <span class="n">repo</span><span class="p">,</span> <span class="o">&</span><span class="n">tree_oid</span><span class="p">),</span> <span class="s">"Error looking up tree"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> - - <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_signature_default-10" class="fnlink" href="../../#HEAD/group/signature/git_signature_default">git_signature_default</a></span><span class="p">(</span><span class="o">&</span><span class="n">signature</span><span class="p">,</span> <span class="n">repo</span><span class="p">),</span> <span class="s">"Error creating signature"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> - + <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_tree_lookup-10" class="fnlink" href="../../#HEAD/group/tree/git_tree_lookup">git_tree_lookup</a></span><span class="p">(</span><span class="o">&</span><span class="n">tree</span><span class="p">,</span> <span class="n">repo</span><span class="p">,</span> <span class="o">&</span><span class="n">tree_oid</span><span class="p">),</span> <span class="s">"Error looking up tree"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> + + <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_signature_default-8" class="fnlink" href="../../#HEAD/group/signature/git_signature_default">git_signature_default</a></span><span class="p">(</span><span class="o">&</span><span class="n">signature</span><span class="p">,</span> <span class="n">repo</span><span class="p">),</span> <span class="s">"Error creating signature"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> + <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_commit_create_v-1" class="fnlink" href="../../#HEAD/group/commit/git_commit_create_v">git_commit_create_v</a></span><span class="p">(</span> <span class="o">&</span><span class="n">commit_oid</span><span class="p">,</span> <span class="n">repo</span><span class="p">,</span> @@ -154,10 +154,8 @@ simulate <code>git commit</code> with the commit message argument.</p> <span class="n">parent</span> <span class="o">?</span> <span class="mi">1</span> <span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="n">parent</span><span class="p">),</span> <span class="s">"Error creating commit"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> <span class="n"><a name="git_index_free-3" class="fnlink" href="../../#HEAD/group/index/git_index_free">git_index_free</a></span><span class="p">(</span><span class="n">index</span><span class="p">);</span> - <span class="n"><a name="git_signature_free-11" class="fnlink" href="../../#HEAD/group/signature/git_signature_free">git_signature_free</a></span><span class="p">(</span><span class="n">signature</span><span class="p">);</span> - <span class="n"><a name="git_tree_free-13" class="fnlink" href="../../#HEAD/group/tree/git_tree_free">git_tree_free</a></span><span class="p">(</span><span class="n">tree</span><span class="p">);</span> - <span class="n"><a name="git_object_free-6" class="fnlink" href="../../#HEAD/group/object/git_object_free">git_object_free</a></span><span class="p">(</span><span class="n">parent</span><span class="p">);</span> - <span class="n"><a name="git_reference_free-7" class="fnlink" href="../../#HEAD/group/reference/git_reference_free">git_reference_free</a></span><span class="p">(</span><span class="n">ref</span><span class="p">);</span> + <span class="n"><a name="git_signature_free-9" class="fnlink" href="../../#HEAD/group/signature/git_signature_free">git_signature_free</a></span><span class="p">(</span><span class="n">signature</span><span class="p">);</span> + <span class="n"><a name="git_tree_free-11" class="fnlink" href="../../#HEAD/group/tree/git_tree_free">git_tree_free</a></span><span class="p">(</span><span class="n">tree</span><span class="p">);</span> <span class="k">return</span> <span class="n">error</span><span class="p">;</span> <span class="p">}</span></pre></div> diff --git a/ex/HEAD/diff.html b/ex/HEAD/diff.html index 847eb24db..0015a1b02 100644 --- a/ex/HEAD/diff.html +++ b/ex/HEAD/diff.html @@ -486,7 +486,7 @@ are not supported in this example</p> <div class='highlight'><pre><span class="k">static</span> <span class="kt">void</span> <span class="nf">diff_print_stats</span><span class="p">(</span><span class="n">git_diff</span> <span class="o">*</span><span class="n">diff</span><span class="p">,</span> <span class="k">struct</span> <span class="n">diff_options</span> <span class="o">*</span><span class="n">o</span><span class="p">)</span> <span class="p">{</span> <span class="n">git_diff_stats</span> <span class="o">*</span><span class="n">stats</span><span class="p">;</span> - <span class="n">git_buf</span> <span class="n">b</span> <span class="o">=</span> <span class="n">GIT_BUF_INIT</span><span class="p">;</span> + <span class="n">git_buf</span> <span class="n">b</span> <span class="o">=</span> <span class="n">GIT_BUF_INIT_CONST</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span> <span class="n">git_diff_stats_format_t</span> <span class="n">format</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">check_lg2</span><span class="p">(</span> diff --git a/ex/HEAD/ls-remote.html b/ex/HEAD/ls-remote.html index dc0f10539..b8ccc9885 100644 --- a/ex/HEAD/ls-remote.html +++ b/ex/HEAD/ls-remote.html @@ -95,7 +95,7 @@ each of the remote references.</p> <td class=code> <div class='highlight'><pre> <span class="n">callbacks</span><span class="p">.</span><span class="n">credentials</span> <span class="o">=</span> <span class="n">cred_acquire_cb</span><span class="p">;</span> - <span class="n">error</span> <span class="o">=</span> <span class="n"><a name="git_remote_connect-6" class="fnlink" href="../../#HEAD/group/remote/git_remote_connect">git_remote_connect</a></span><span class="p">(</span><span class="n">remote</span><span class="p">,</span> <span class="n">GIT_DIRECTION_FETCH</span><span class="p">,</span> <span class="o">&</span><span class="n">callbacks</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> + <span class="n">error</span> <span class="o">=</span> <span class="n"><a name="git_remote_connect-4" class="fnlink" href="../../#HEAD/group/remote/git_remote_connect">git_remote_connect</a></span><span class="p">(</span><span class="n">remote</span><span class="p">,</span> <span class="n">GIT_DIRECTION_FETCH</span><span class="p">,</span> <span class="o">&</span><span class="n">callbacks</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="n">error</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> <span class="k">goto</span> <span class="n">cleanup</span><span class="p">;</span></pre></div> </td> @@ -109,7 +109,7 @@ each of the remote references.</p> their name next to what they point to.</p> </td> <td class=code> - <div class='highlight'><pre> <span class="k">if</span> <span class="p">(</span><span class="n"><a name="git_remote_ls-4" class="fnlink" href="../../#HEAD/group/remote/git_remote_ls">git_remote_ls</a></span><span class="p">(</span><span class="o">&</span><span class="n">refs</span><span class="p">,</span> <span class="o">&</span><span class="n">refs_len</span><span class="p">,</span> <span class="n">remote</span><span class="p">)</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> + <div class='highlight'><pre> <span class="k">if</span> <span class="p">(</span><span class="n"><a name="git_remote_ls-5" class="fnlink" href="../../#HEAD/group/remote/git_remote_ls">git_remote_ls</a></span><span class="p">(</span><span class="o">&</span><span class="n">refs</span><span class="p">,</span> <span class="o">&</span><span class="n">refs_len</span><span class="p">,</span> <span class="n">remote</span><span class="p">)</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> <span class="k">goto</span> <span class="n">cleanup</span><span class="p">;</span> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">refs_len</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> @@ -119,7 +119,7 @@ their name next to what they point to.</p> <span class="p">}</span> <span class="nl">cleanup</span><span class="p">:</span> - <span class="n"><a name="git_remote_free-5" class="fnlink" href="../../#HEAD/group/remote/git_remote_free">git_remote_free</a></span><span class="p">(</span><span class="n">remote</span><span class="p">);</span> + <span class="n"><a name="git_remote_free-6" class="fnlink" href="../../#HEAD/group/remote/git_remote_free">git_remote_free</a></span><span class="p">(</span><span class="n">remote</span><span class="p">);</span> <span class="k">return</span> <span class="n">error</span><span class="p">;</span> <span class="p">}</span></pre></div> </td> diff --git a/ex/HEAD/remote.html b/ex/HEAD/remote.html index 9e85f9ea7..036dded10 100644 --- a/ex/HEAD/remote.html +++ b/ex/HEAD/remote.html @@ -100,7 +100,7 @@ program is emulating.</p> <span class="n">subcmd_remove</span><span class="p">,</span> <span class="n">subcmd_rename</span><span class="p">,</span> <span class="n">subcmd_seturl</span><span class="p">,</span> - <span class="n">subcmd_show</span> + <span class="n">subcmd_show</span><span class="p">,</span> <span class="p">};</span> <span class="k">struct</span> <span class="n">remote_opts</span> <span class="p">{</span> diff --git a/ex/HEAD/status.html b/ex/HEAD/status.html index 43876b41f..84efdd3a2 100644 --- a/ex/HEAD/status.html +++ b/ex/HEAD/status.html @@ -114,7 +114,7 @@ from <code>git status</code></li> <span class="n">FORMAT_DEFAULT</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">FORMAT_LONG</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="n">FORMAT_SHORT</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span> - <span class="n">FORMAT_PORCELAIN</span> <span class="o">=</span> <span class="mi">3</span> + <span class="n">FORMAT_PORCELAIN</span> <span class="o">=</span> <span class="mi">3</span><span class="p">,</span> <span class="p">};</span> <span class="cp">#define MAX_PATHSPEC 8</span> |