Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
sha1-name.c: remove the_repo from get_oid_oneline()
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Tue, 16 Apr 2019 09:33:29 +0000
(16:33 +0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 16 Apr 2019 09:56:52 +0000
(18:56 +0900)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1-name.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
71588ed
)
diff --git
a/sha1-name.c
b/sha1-name.c
index 49c62d52543c7ec2a55693c22dc6dc315db50164..fb80306f1a6aa7b341d8fe0979b7a0401f1cb01f 100644
(file)
--- a/
sha1-name.c
+++ b/
sha1-name.c
@@
-15,7
+15,7
@@
#include "midx.h"
#include "commit-reach.h"
#include "midx.h"
#include "commit-reach.h"
-static int get_oid_oneline(const char *, struct object_id *, struct commit_list *);
+static int get_oid_oneline(
struct repository *r,
const char *, struct object_id *, struct commit_list *);
typedef int (*disambiguate_hint_fn)(struct repository *, const struct object_id *, void *);
typedef int (*disambiguate_hint_fn)(struct repository *, const struct object_id *, void *);
@@
-1090,7
+1090,7
@@
static int peel_onion(const char *name, int len, struct object_id *oid,
prefix = xstrndup(sp + 1, name + len - 1 - (sp + 1));
commit_list_insert((struct commit *)o, &list);
prefix = xstrndup(sp + 1, name + len - 1 - (sp + 1));
commit_list_insert((struct commit *)o, &list);
- ret = get_oid_oneline(prefix, oid, list);
+ ret = get_oid_oneline(
the_repository,
prefix, oid, list);
free(prefix);
return ret;
}
free(prefix);
return ret;
}
@@
-1204,8
+1204,9
@@
static int handle_one_ref(const char *path, const struct object_id *oid,
return 0;
}
return 0;
}
-static int get_oid_oneline(const char *prefix, struct object_id *oid,
- struct commit_list *list)
+static int get_oid_oneline(struct repository *r,
+ const char *prefix, struct object_id *oid,
+ struct commit_list *list)
{
struct commit_list *backup = NULL, *l;
int found = 0;
{
struct commit_list *backup = NULL, *l;
int found = 0;
@@
-1236,7
+1237,7
@@
static int get_oid_oneline(const char *prefix, struct object_id *oid,
int matches;
commit = pop_most_recent_commit(&list, ONELINE_SEEN);
int matches;
commit = pop_most_recent_commit(&list, ONELINE_SEEN);
- if (!parse_object(
the_repository
, &commit->object.oid))
+ if (!parse_object(
r
, &commit->object.oid))
continue;
buf = get_commit_buffer(commit, NULL);
p = strstr(buf, "\n\n");
continue;
buf = get_commit_buffer(commit, NULL);
p = strstr(buf, "\n\n");
@@
-1760,7
+1761,7
@@
static enum get_oid_result get_oid_with_context_1(struct repository *repo,
for_each_ref(handle_one_ref, &list);
head_ref(handle_one_ref, &list);
commit_list_sort_by_date(&list);
for_each_ref(handle_one_ref, &list);
head_ref(handle_one_ref, &list);
commit_list_sort_by_date(&list);
- return get_oid_oneline(name + 2, oid, list);
+ return get_oid_oneline(
repo,
name + 2, oid, list);
}
if (namelen < 3 ||
name[2] != ':' ||
}
if (namelen < 3 ||
name[2] != ':' ||